com php-src: use constant numbers: phpdbg_prompt.c

From: Date: Thu, 21 Nov 2013 16:41:41 +0000
Subject: com php-src: use constant numbers: phpdbg_prompt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74722@lists.php.net to get a copy of this message
Commit: a13583d1dfdb085b83500ce93733ee0349816ca8 Author: krakjoe <joe.watkins@live.co.uk> Thu, 21 Nov 2013 16:41:41 +0000 Parents: a3bcdba660e3fb8b60fe67c9aee1029d6477f3fb Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a13583d1dfdb085b83500ce93733ee0349816ca8 Log: use constant numbers Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 88c2f0f..016474b 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -1025,6 +1025,20 @@ out: return ret; } /* }}} */ +static inline zend_uint phpdbg_decode_literal(zend_op_array *ops, zend_literal *literal TSRMLS_DC) /* {{{ */ +{ + zend_uint iter = 0; + + while (iter < ops->last_literal) { + if (literal == &ops->literals[iter]) { + return iter; + } + iter++; + } + + return 0; +} /* }}} */ + static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint type, HashTable *vars TSRMLS_DC) /* {{{ */ { char *decode = NULL; @@ -1048,7 +1062,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint } break; case IS_CONST: - asprintf(&decode, "<constant>"); + asprintf(&decode, "C%lu", phpdbg_decode_literal(ops, op->literal TSRMLS_CC)); break; case IS_UNUSED:

« previous php.cvs (#74722) next »