diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-29 00:08:55 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-29 00:11:02 +0200 |
commit | 86b4863837edbd9aaac1aeea3f0101076ef55f09 (patch) | |
tree | bfab75f75117de86bc805b461c68b05b402818a3 /compiler.c | |
parent | 0e245093909c0445267187b1f396630301965f1a (diff) |
compiler: fix segfault on parsing invalid pre/post increment expressions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'compiler.c')
-rw-r--r-- | compiler.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -820,7 +820,7 @@ uc_compiler_emit_inc_dec(uc_compiler *compiler, uc_tokentype_t toktype, bool is_ uint32_t cidx = 0; /* determine kind of emitted load instruction and operand value (if any) */ - type = chunk->entries[compiler->last_insn]; + type = chunk->entries ? chunk->entries[compiler->last_insn] : 0; if (type == I_LVAR || type == I_LLOC || type == I_LUPV) { cidx = uc_compiler_get_u32(compiler, compiler->last_insn + 1); |