Permalink
Browse files

Pass on the exit status

  • Loading branch information...
1 parent 6c1af20 commit 2ef6b689e8f3c5ddd62c790f8f429cece8a57ff9 Sascha Schumann committed Nov 22, 2000
Showing with 8 additions and 1 deletion.
  1. +7 −1 Zend/zend_execute.c
  2. +1 −0 Zend/zend_globals.h
View
@@ -2280,7 +2280,13 @@ binary_assign_op_addr: {
NEXT_OPCODE();
case ZEND_EXIT:
if (opline->op1.op_type != IS_UNUSED) {
- zend_print_variable(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R));
+ zval *ptr;
+
+ ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ }
+ zend_print_variable(ptr);
FREE_OP(&opline->op1, EG(free_op1));
}
zend_bailout();
View
@@ -151,6 +151,7 @@ struct _zend_executor_globals {
int error_reporting;
int orig_error_reporting;
+ int exit_status;
zend_op_array *active_op_array;

0 comments on commit 2ef6b68

Please sign in to comment.