diff options
author | Johannes Schlüter <johannes@php.net> | 2014-01-18 13:52:27 +0100 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2014-01-18 13:52:27 +0100 |
commit | 8ff4d61f0864fbca7b2905f14de76fd400d9b3df (patch) | |
tree | 0b7513b2b81fe50e76522365d55297a53955fe72 /sapi/phpdbg/phpdbg_opcode.c | |
parent | 43a8f4f81439455d22471822bfa5f61708a2dc17 (diff) | |
parent | c205a6f3de9d8923c2be6e16b1edc332981313a3 (diff) | |
download | php-git-8ff4d61f0864fbca7b2905f14de76fd400d9b3df.tar.gz |
Merge branch 'phpdbg' into PHP-5.6
Diffstat (limited to 'sapi/phpdbg/phpdbg_opcode.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_opcode.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 7e64d16d92..50073eb22b 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -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; |