Skip to content

Instantly share code, notes, and snippets.

@dstogov
Last active January 21, 2016 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstogov/0a2c873b3a2696a4e581 to your computer and use it in GitHub Desktop.
Save dstogov/0a2c873b3a2696a4e581 to your computer and use it in GitHub Desktop.
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 927c75b..8a313d9 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -2355,12 +2355,12 @@ ZEND_FUNCTION(debug_print_backtrace)
filename = ZSTR_VAL(skip->func->op_array.filename);
if (skip->opline->opcode == ZEND_HANDLE_EXCEPTION) {
if (EG(opline_before_exception)) {
- lineno = EG(opline_before_exception)->lineno;
+ lineno = 0 /*???EG(opline_before_exception)->lineno*/;
} else {
lineno = skip->func->op_array.line_end;
}
} else {
- lineno = skip->opline->lineno;
+ lineno = 0 /*???skip->opline->lineno*/;
}
} else {
filename = NULL;
@@ -2468,7 +2468,7 @@ ZEND_FUNCTION(debug_print_backtrace)
break;
}
if (prev->func && ZEND_USER_CODE(prev->func->common.type)) {
- zend_printf(") called at [%s:%d]\n", ZSTR_VAL(prev->func->op_array.filename), prev->opline->lineno);
+ zend_printf(") called at [%s:%d]\n", ZSTR_VAL(prev->func->op_array.filename), 0/*???prev->opline->lineno*/);
break;
}
prev_call = prev;
@@ -2551,12 +2551,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
filename = skip->func->op_array.filename;
if (skip->opline->opcode == ZEND_HANDLE_EXCEPTION) {
if (EG(opline_before_exception)) {
- lineno = EG(opline_before_exception)->lineno;
+ lineno = 0 /*???EG(opline_before_exception)->lineno*/;
} else {
lineno = skip->func->op_array.line_end;
}
} else {
- lineno = skip->opline->lineno;
+ lineno = 0 /*???skip->opline->lineno*/;
}
add_assoc_str_ex(&stack_frame, "file", sizeof("file")-1, zend_string_copy(filename));
add_assoc_long_ex(&stack_frame, "line", sizeof("line")-1, lineno);
@@ -2577,7 +2577,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
if (prev->func && ZEND_USER_CODE(prev->func->common.type)) {
add_assoc_str_ex(&stack_frame, "file", sizeof("file")-1, zend_string_copy(prev->func->op_array.filename));
- add_assoc_long_ex(&stack_frame, "line", sizeof("line")-1, prev->opline->lineno);
+ add_assoc_long_ex(&stack_frame, "line", sizeof("line")-1, 0 /*???prev->opline->lineno*/);
break;
}
prev_call = prev;
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 8ac9819..ff5960c 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -233,7 +233,7 @@ void zend_oparray_context_begin(zend_oparray_context *prev_context) /* {{{ */
CG(context).literals_size = 0;
CG(context).backpatch_count = 0;
CG(context).in_finally = 0;
- CG(context).fast_call_var = -1;
+ CG(context).fast_call_var = ZEND_BAD_VAR;
CG(context).current_brk_cont = -1;
CG(context).last_brk_cont = 0;
CG(context).brk_cont_array = NULL;
@@ -1064,7 +1064,7 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opli
zend_error_noreturn(error_level, "Cannot redeclare %s() (previously declared in %s:%d)",
ZSTR_VAL(function->common.function_name),
ZSTR_VAL(old_function->op_array.filename),
- old_function->op_array.opcodes[0].lineno);
+ old_function->op_array.line_start);
} else {
zend_error_noreturn(error_level, "Cannot redeclare %s()", ZSTR_VAL(function->common.function_name));
}
@@ -1192,9 +1192,9 @@ void zend_do_early_binding(void) /* {{{ */
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
(ce->type == ZEND_INTERNAL_CLASS))) {
if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) {
- uint32_t *opline_num = &CG(active_op_array)->early_binding;
+ uint16_t *opline_num = &CG(active_op_array)->early_binding;
- while (*opline_num != (uint32_t)-1) {
+ while (*opline_num != (uint16_t)-1) {
opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num;
}
*opline_num = opline - CG(active_op_array)->opcodes;
@@ -1263,11 +1263,11 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array) /* {{
{
if (op_array->early_binding != (uint32_t)-1) {
zend_bool orig_in_compilation = CG(in_compilation);
- uint32_t opline_num = op_array->early_binding;
+ uint16_t opline_num = op_array->early_binding;
zend_class_entry *ce;
CG(in_compilation) = 1;
- while (opline_num != (uint32_t)-1) {
+ while (opline_num != (uint16_t)-1) {
zval *parent_name = RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2);
if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) {
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
@@ -3978,7 +3978,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */
) {
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
- CG(zend_lineno) = opline->lineno;
+ CG(zend_lineno) = 0 /*???opline->lineno*/;
zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
}
@@ -3990,7 +3990,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */
if (current == -1) {
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
- CG(zend_lineno) = opline->lineno;
+ CG(zend_lineno) = 0 /*???opline->lineno*/;
zend_error_noreturn(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed");
}
if (CG(context).brk_cont_array[current].start >= 0) {
@@ -5212,7 +5212,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast) /* {{{ */
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
zend_op *opline_ext = zend_emit_op(NULL, ZEND_EXT_NOP, NULL, NULL);
- opline_ext->lineno = decl->start_lineno;
+//??? opline_ext->lineno = decl->start_lineno;
}
{
@@ -7087,11 +7087,11 @@ static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */
while (opline != init_opline) {
opline--;
if (opline->opcode == ZEND_ROPE_ADD &&
- opline->result.var == -1) {
+ opline->result.var == ZEND_BAD_VAR) {
opline->op1.var = var;
opline->result.var = var;
} else if (opline->opcode == ZEND_ROPE_INIT &&
- opline->result.var == -1) {
+ opline->result.var == ZEND_BAD_VAR) {
opline->result.var = var;
}
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 5b5f199..092d26d 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -59,26 +59,30 @@ typedef struct _zend_op zend_op;
* performance. So on 32-bit systems we use absolute addresses for jump
* targets and constants, but on 64-bit systems realtive 32-bit offsets */
#if SIZEOF_SIZE_T == 4
-# define ZEND_USE_ABS_JMP_ADDR 1
-# define ZEND_USE_ABS_CONST_ADDR 1
+# define ZEND_USE_ABS_JMP_ADDR 0
+# define ZEND_USE_ABS_CONST_ADDR 0
+# define ZEND_USE_ABS_HANDLER 1
# define ZEND_EX_USE_LITERALS 0
# define ZEND_EX_USE_RUN_TIME_CACHE 1
#else
# define ZEND_USE_ABS_JMP_ADDR 0
# define ZEND_USE_ABS_CONST_ADDR 0
+# define ZEND_USE_ABS_HANDLER 0
# define ZEND_EX_USE_LITERALS 1
# define ZEND_EX_USE_RUN_TIME_CACHE 1
#endif
+#define ZEND_BAD_VAR ((uint16_t)-1)
+
typedef union _znode_op {
- uint32_t constant;
- uint32_t var;
- uint32_t num;
- uint32_t opline_num; /* Needs to be signed */
+ uint16_t constant;
+ uint16_t var;
+ uint16_t num;
+ uint16_t opline_num; /* Needs to be signed */
#if ZEND_USE_ABS_JMP_ADDR
zend_op *jmp_addr;
#else
- uint32_t jmp_offset;
+ uint16_t jmp_offset;
#endif
#if ZEND_USE_ABS_CONST_ADDR
zval *zv;
@@ -141,12 +145,16 @@ void zend_const_expr_to_zval(zval *result, zend_ast *ast);
typedef int (*user_opcode_handler_t) (zend_execute_data *execute_data);
struct _zend_op {
+#if ZEND_USE_ABS_HANDLER
const void *handler;
+#else
+ int32_t _handler;
+#endif
znode_op op1;
znode_op op2;
znode_op result;
- uint32_t extended_value;
- uint32_t lineno;
+ uint16_t extended_value;
+//??? uint32_t lineno;
zend_uchar opcode;
zend_uchar op1_type;
zend_uchar op2_type;
@@ -180,7 +188,7 @@ typedef struct _zend_try_catch_element {
#define ZEND_LIVE_MASK 3
typedef struct _zend_live_range {
- uint32_t var; /* low bits are used for variable type (ZEND_LIVE_* macros) */
+ uint16_t var; /* low bits are used for variable type (ZEND_LIVE_* macros) */
uint32_t start;
uint32_t end;
} zend_live_range;
@@ -192,7 +200,7 @@ typedef struct _zend_oparray_context {
int literals_size;
int backpatch_count;
int in_finally;
- uint32_t fast_call_var;
+ uint16_t fast_call_var;
int current_brk_cont;
int last_brk_cont;
zend_brk_cont_element *brk_cont_array;
@@ -503,13 +511,13 @@ struct _zend_execute_data {
((int)((ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval))))
#define ZEND_CALL_VAR(call, n) \
- ((zval*)(((char*)(call)) + ((int)(n))))
+ ((zval*)(((char*)(call)) + ((int16_t)(n))))
#define ZEND_CALL_VAR_NUM(call, n) \
- (((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + ((int)(n))))
+ (((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + ((int16_t)(n))))
#define ZEND_CALL_ARG(call, n) \
- ZEND_CALL_VAR_NUM(call, ((int)(n)) - 1)
+ ZEND_CALL_VAR_NUM(call, ((int16_t)(n)) - 1)
#define EX(element) ((execute_data)->element)
@@ -543,7 +551,7 @@ struct _zend_execute_data {
((char*)&(op_array)->opcodes[opline_num] - (char*)(opline))
#define ZEND_OFFSET_TO_OPLINE(base, offset) \
- ((zend_op*)(((char*)(base)) + (int)offset))
+ ((zend_op*)(((char*)(base)) + (int16_t)offset))
#define ZEND_OFFSET_TO_OPLINE_NUM(op_array, base, offset) \
(ZEND_OFFSET_TO_OPLINE(base, offset) - op_array->opcodes)
@@ -677,6 +685,22 @@ struct _zend_execute_data {
#endif
+#if ZEND_USE_ABS_HANDLER
+# define GET_OPLINE_HANDLER(opline) \
+ ((opcode_handler_t)(opline)->handler)
+# define SET_OPLINE_HANDLER(opline, func) \
+ do { \
+ (opline)->handler = (void*)(func); \
+ }while (0)
+#else
+# define GET_OPLINE_HANDLER(opline) \
+ ((opcode_handler_t)((char*)execute_ex + (opline)->_handler))
+# define SET_OPLINE_HANDLER(opline, func) \
+ do { \
+ (opline)->_handler = (int32_t)((char*)(func) - (char*)execute_ex); \
+ }while (0)
+#endif
+
#define IS_CONST (1<<0)
#define IS_TMP_VAR (1<<1)
#define IS_VAR (1<<2)
@@ -888,20 +912,20 @@ ZEND_API void zend_assert_valid_class_name(const zend_string *const_name);
#define ZEND_RT (1<<1)
/* global/local fetches */
-#define ZEND_FETCH_GLOBAL 0x00000000
-#define ZEND_FETCH_LOCAL 0x10000000
-#define ZEND_FETCH_GLOBAL_LOCK 0x40000000
+#define ZEND_FETCH_LOCAL 0x0000
+#define ZEND_FETCH_GLOBAL 0x4000
+#define ZEND_FETCH_GLOBAL_LOCK 0x8000
-#define ZEND_FETCH_TYPE_MASK 0x70000000
+#define ZEND_FETCH_TYPE_MASK 0xc000
-#define ZEND_FETCH_STANDARD 0x00000000
+#define ZEND_FETCH_STANDARD 0x0000
-#define ZEND_ISSET 0x02000000
-#define ZEND_ISEMPTY 0x01000000
+#define ZEND_ISSET 0x2000
+#define ZEND_ISEMPTY 0x1000
#define ZEND_ISSET_ISEMPTY_MASK (ZEND_ISSET | ZEND_ISEMPTY)
-#define ZEND_QUICK_SET 0x00800000
+#define ZEND_QUICK_SET 0x0800
-#define ZEND_FETCH_ARG_MASK 0x000fffff
+#define ZEND_FETCH_ARG_MASK 0x03ff
#define ZEND_FREE_ON_RETURN (1<<0)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index fffcb9c..cd11131 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -643,7 +643,7 @@ static ZEND_COLD void zend_verify_arg_error(const zend_function *zf, uint32_t ar
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d",
arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind,
- ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
+ ZSTR_VAL(ptr->func->op_array.filename), 0 /*???ptr->opline->lineno*/);
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
}
@@ -900,7 +900,7 @@ static ZEND_COLD void zend_verify_missing_arg(zend_execute_data *execute_data, u
zend_execute_data *ptr = EX(prev_execute_data);
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
- zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", arg_num, class_name, space, func_name, ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
+ zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", arg_num, class_name, space, func_name, ZSTR_VAL(ptr->func->op_array.filename), 0 /*???ptr->opline->lineno*/);
} else {
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
}
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 0c6f037..b245703 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -510,12 +510,15 @@ ZEND_API uint zend_get_executed_lineno(void) /* {{{ */
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
- if (ex) {
+
+ if (0 /*???ex*/) {
+/*
if (EG(exception) && ex->opline->opcode == ZEND_HANDLE_EXCEPTION &&
ex->opline->lineno == 0 && EG(opline_before_exception)) {
return EG(opline_before_exception)->lineno;
}
return ex->opline->lineno;
+*/
} else {
return 0;
}
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index cff2948..1d6410d 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -444,7 +444,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
void init_op(zend_op *op)
{
memset(op, 0, sizeof(zend_op));
- op->lineno = CG(zend_lineno);
+//??? op->lineno = CG(zend_lineno);
SET_UNUSED(op->result);
}
@@ -490,7 +490,7 @@ static void zend_update_extended_info(zend_op_array *op_array)
continue;
}
if (opline+1<end) {
- opline->lineno = (opline+1)->lineno;
+//??? opline->lineno = (opline+1)->lineno;
}
} else {
opline->opcode = ZEND_NOP;
@@ -518,7 +518,7 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num
dst_num <= op_array->try_catch_array[i].finally_end)) {
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
- CG(zend_lineno) = op_array->opcodes[op_num].lineno;
+ CG(zend_lineno) = 0 /*???op_array->opcodes[op_num].lineno*/;
zend_error_noreturn(E_COMPILE_ERROR, "jump into a finally block is disallowed");
} else if ((op_num >= op_array->try_catch_array[i].finally_op
&& op_num <= op_array->try_catch_array[i].finally_end)
@@ -526,7 +526,7 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num
|| dst_num < op_array->try_catch_array[i].finally_op)) {
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
- CG(zend_lineno) = op_array->opcodes[op_num].lineno;
+ CG(zend_lineno) = 0 /*???op_array->opcodes[op_num].lineno*/;
zend_error_noreturn(E_COMPILE_ERROR, "jump out of a finally block is disallowed");
}
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 080c799..a803310 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -411,10 +411,10 @@ ZEND_API void execute_ex(zend_execute_data *ex)
int ret;
#endif
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
- ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ GET_OPLINE_HANDLER(OPLINE)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
if (UNEXPECTED(!OPLINE)) {
#else
- if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) {
+ if (UNEXPECTED((ret = GET_OPLINE_HANDLER(OPLINE)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) {
#endif
#ifdef ZEND_VM_FP_GLOBAL_REG
execute_data = orig_execute_data;
@@ -49475,7 +49475,7 @@ static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op*
ZEND_API void zend_vm_set_opcode_handler(zend_op* op)
{
- op->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);
+ SET_OPLINE_HANDLER(op, zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op));
}
ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
@@ -49493,7 +49493,7 @@ ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
LOAD_OPLINE();
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
- ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ GET_OPLINE_HANDLER(OPLINE)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
if (EXPECTED(opline)) {
ret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;
SAVE_OPLINE();
@@ -49501,7 +49501,7 @@ ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
ret = -1;
}
#else
- ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ ret = GET_OPLINE_HANDLER(OPLINE)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
SAVE_OPLINE();
#endif
#ifdef ZEND_VM_FP_GLOBAL_REG
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 27731dd..58b9bb3 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -559,13 +559,13 @@ failure:
function2 = Z_PTR_P(t);
CG(in_compilation) = 1;
zend_set_compiled_filename(function1->op_array.filename);
- CG(zend_lineno) = function1->op_array.opcodes[0].lineno;
+ CG(zend_lineno) = function1->op_array.line_start;
if (function2->type == ZEND_USER_FUNCTION
&& function2->op_array.last > 0) {
zend_error(E_ERROR, "Cannot redeclare %s() (previously declared in %s:%d)",
ZSTR_VAL(function1->common.function_name),
ZSTR_VAL(function2->op_array.filename),
- (int)function2->op_array.opcodes[0].lineno);
+ (int)function2->op_array.line_start);
} else {
zend_error(E_ERROR, "Cannot redeclare %s()", ZSTR_VAL(function1->common.function_name));
}
@@ -603,13 +603,13 @@ failure:
function2 = Z_PTR_P(t);
CG(in_compilation) = 1;
zend_set_compiled_filename(function1->op_array.filename);
- CG(zend_lineno) = function1->op_array.opcodes[0].lineno;
+ CG(zend_lineno) = function1->op_array.line_start;
if (function2->type == ZEND_USER_FUNCTION
&& function2->op_array.last > 0) {
zend_error(E_ERROR, "Cannot redeclare %s() (previously declared in %s:%d)",
ZSTR_VAL(function1->common.function_name),
ZSTR_VAL(function2->op_array.filename),
- (int)function2->op_array.opcodes[0].lineno);
+ (int)function2->op_array.line_start);
} else {
zend_error(E_ERROR, "Cannot redeclare %s()", ZSTR_VAL(function1->common.function_name));
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 7713137..96205fa 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2263,7 +2263,7 @@ ZEND_METHOD(reflection_generator, getExecutingLine)
REFLECTION_CHECK_VALID_GENERATOR(ex)
- ZVAL_LONG(return_value, ex->opline->lineno);
+ ZVAL_LONG(return_value, 0 /*???ex->opline->lineno*/);
}
/* }}} */
diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c
index e6482b6..2e150f9 100644
--- a/sapi/fpm/fpm/fpm_php_trace.c
+++ b/sapi/fpm/fpm/fpm_php_trace.c
@@ -164,14 +164,14 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ *
}
if (valid_ptr(l)) {
- long opline = l;
- uint32_t *lu = (uint32_t *) &l;
-
- if (0 > fpm_trace_get_long(opline + offsetof(struct _zend_op, lineno), &l)) {
- return -1;
- }
-
- lineno = *lu;
+//??? long opline = l;
+//??? uint32_t *lu = (uint32_t *) &l;
+//???
+//??? if (0 > fpm_trace_get_long(opline + offsetof(struct _zend_op, lineno), &l)) {
+//??? return -1;
+//??? }
+//???
+ lineno = 0/*???*lu*/;
}
break;
}
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 54e9a66..96c49f7 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -466,7 +466,7 @@ static void phpdbg_oplog_fill_executable(zend_op_array *op_array, HashTable *ins
if (by_opcode) {
insert_idx = cur - op_array->opcodes;
} else {
- insert_idx = cur->lineno;
+ insert_idx = 0 /*???cur->lineno*/;
}
if (cur->opcode == ZEND_NEW && (cur + 1)->opcode == ZEND_DO_FCALL) {
@@ -664,7 +664,7 @@ static PHP_FUNCTION(phpdbg_end_oplog)
if (by_opcode) {
insert_idx = cur->op - cur->opcodes;
} else {
- insert_idx = cur->op->lineno;
+ insert_idx = 0 /*???cur->op->lineno*/;
}
{
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index eac67d4..594b015 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -902,9 +902,9 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_
return NULL;
}
- if (EG(current_execute_data) && (brake = zend_hash_index_find_ptr(breaks, EG(current_execute_data)->opline->lineno))) {
- return brake;
- }
+//??? if (EG(current_execute_data) && (brake = zend_hash_index_find_ptr(breaks, EG(current_execute_data)->opline->lineno))) {
+//??? return brake;
+//??? }
return NULL;
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 70dab12..2e3033c 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -183,7 +183,7 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_fl
if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) {
/* output line info */
phpdbg_notice("opline", "line=\"%u\" opline=\"%p\" op=\"%s\" file=\"%s\"", "L%-5u %16p %s %s",
- opline->lineno,
+ 0 /*???opline->lineno*/,
opline,
decode,
execute_data->func->op_array.filename ? ZSTR_VAL(execute_data->func->op_array.filename) : "unknown");
@@ -191,7 +191,7 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_fl
if (!ignore_flags && PHPDBG_G(oplog)) {
phpdbg_log_ex(fileno(PHPDBG_G(oplog)), "L%-5u %16p %s %s\n",
- opline->lineno,
+ 0 /*???opline->lineno*/,
opline,
decode,
execute_data->func->op_array.filename ? ZSTR_VAL(execute_data->func->op_array.filename) : "unknown");
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 6b6c706..90b8a88 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -83,7 +83,7 @@ static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */
do {
char *decode = phpdbg_decode_opline(op_array, opline);
phpdbg_writeln("print", "line=\"%u\" opnum=\"%u\" op=\"%s\"", " L%-4u #%-5u %s",
- opline->lineno,
+ 0 /*???opline->lineno*/,
opcode,
decode);
efree(decode);
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 796519f..0fad5ec 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -524,6 +524,7 @@ int phpdbg_skip_line_helper() /* {{{ */ {
PHPDBG_G(flags) |= PHPDBG_IN_UNTIL;
PHPDBG_G(seek_ex) = EG(current_execute_data);
do {
+/*???
if (opline->lineno != EG(current_execute_data)->opline->lineno
|| opline->opcode == ZEND_RETURN
|| opline->opcode == ZEND_FAST_RET
@@ -534,6 +535,7 @@ int phpdbg_skip_line_helper() /* {{{ */ {
) {
zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong) opline, (void *) opline);
}
+*/
} while (++opline < op_array->opcodes + op_array->last);
return PHPDBG_UNTIL;
@@ -1584,10 +1586,10 @@ ex_is_caught:
/* not while in conditionals */
phpdbg_print_opline_ex(execute_data, 0);
- if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
- PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING;
- DO_INTERACTIVE(1);
- }
+//??? if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
+//??? PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING;
+//??? DO_INTERACTIVE(1);
+//??? }
/* check if some watchpoint was hit */
{
@@ -1600,12 +1602,12 @@ ex_is_caught:
{
phpdbg_breakbase_t *brake;
- if ((PHPDBG_G(flags) & PHPDBG_BP_MASK)
- && (brake = phpdbg_find_breakpoint(execute_data))
- && (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
- phpdbg_hit_breakpoint(brake, 1);
- DO_INTERACTIVE(1);
- }
+//??? if ((PHPDBG_G(flags) & PHPDBG_BP_MASK)
+//??? && (brake = phpdbg_find_breakpoint(execute_data))
+//??? && (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
+//??? phpdbg_hit_breakpoint(brake, 1);
+//??? DO_INTERACTIVE(1);
+//??? }
}
if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
@@ -1618,7 +1620,7 @@ ex_is_caught:
next:
- PHPDBG_G(last_line) = execute_data->opline->lineno;
+//??? PHPDBG_G(last_line) = execute_data->opline->lineno;
/* stupid hack to make zend_do_fcall_common_helper return ZEND_VM_ENTER() instead of recursively calling zend_execute() and eventually segfaulting */
if ((execute_data->opline->opcode == ZEND_DO_FCALL ||
@@ -1652,7 +1654,7 @@ void phpdbg_force_interruption(void) /* {{{ */ {
if (data) {
if (data->func) {
if (ZEND_USER_CODE(data->func->type)) {
- phpdbg_notice("hardinterrupt", "opline=\"%p\" num=\"%lu\" file=\"%s\" line=\"%u\"", "Current opline: %p (op #%lu) in %s:%u", data->opline, (data->opline - data->func->op_array.opcodes) / sizeof(data->opline), data->func->op_array.filename->val, data->opline->lineno);
+ phpdbg_notice("hardinterrupt", "opline=\"%p\" num=\"%lu\" file=\"%s\" line=\"%u\"", "Current opline: %p (op #%lu) in %s:%u", data->opline, (data->opline - data->func->op_array.opcodes) / sizeof(data->opline), data->func->op_array.filename->val, 0 /*???data->opline->lineno*/);
} else if (data->func->internal_function.function_name) {
phpdbg_notice("hardinterrupt", "func=\"%s\"", "Current opline: in internal function %s", data->func->internal_function.function_name->val);
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment