Skip to content

Commit a13583d

Browse files
committed
use constant numbers
1 parent a3bcdba commit a13583d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

phpdbg_prompt.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,20 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
10251025
return ret;
10261026
} /* }}} */
10271027

1028+
static inline zend_uint phpdbg_decode_literal(zend_op_array *ops, zend_literal *literal TSRMLS_DC) /* {{{ */
1029+
{
1030+
zend_uint iter = 0;
1031+
1032+
while (iter < ops->last_literal) {
1033+
if (literal == &ops->literals[iter]) {
1034+
return iter;
1035+
}
1036+
iter++;
1037+
}
1038+
1039+
return 0;
1040+
} /* }}} */
1041+
10281042
static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint type, HashTable *vars TSRMLS_DC) /* {{{ */
10291043
{
10301044
char *decode = NULL;
@@ -1048,7 +1062,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint
10481062
} break;
10491063

10501064
case IS_CONST:
1051-
asprintf(&decode, "<constant>");
1065+
asprintf(&decode, "C%lu", phpdbg_decode_literal(ops, op->literal TSRMLS_CC));
10521066
break;
10531067

10541068
case IS_UNUSED:

0 commit comments

Comments
 (0)