diff options
author | krakjoe <joe.watkins@live.co.uk> | 2014-02-02 13:42:01 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2014-02-02 13:42:01 +0000 |
commit | a4a120d66aaf44cd0dc71f39a49998b924c2ef0e (patch) | |
tree | f48300cf85374f82a437a42f3a2d4ed88867f34d /sapi/phpdbg/phpdbg_opcode.c | |
parent | 8a7e2f8dd2116ff6ada654e301c593accf337250 (diff) | |
parent | 05c309f2d85bcc33e95415d7f50d7748a7c27498 (diff) | |
download | php-git-a4a120d66aaf44cd0dc71f39a49998b924c2ef0e.tar.gz |
Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6
Diffstat (limited to 'sapi/phpdbg/phpdbg_opcode.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_opcode.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 025d57a08d..50073eb22b 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -52,13 +52,15 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint case IS_VAR: case IS_TMP_VAR: { zend_ulong id = 0, *pid = NULL; - if (zend_hash_index_find(vars, (zend_ulong) ops->vars - op->var, (void**) &pid) != SUCCESS) { - id = zend_hash_num_elements(vars); - zend_hash_index_update( - vars, (zend_ulong) ops->vars - op->var, - (void**) &id, - sizeof(zend_ulong), NULL); - } else id = *pid; + if (vars != NULL) { + if (zend_hash_index_find(vars, (zend_ulong) ops->vars - op->var, (void**) &pid) != SUCCESS) { + id = zend_hash_num_elements(vars); + zend_hash_index_update( + vars, (zend_ulong) ops->vars - op->var, + (void**) &id, + sizeof(zend_ulong), NULL); + } else id = *pid; + } asprintf(&decode, "@%lu", id); } break; |