Commit e344d662 authored by Jose Narvaez's avatar Jose Narvaez

Fixed dereference to null pointer in 'codegen.c' reported by 'clang-analyzer'

parent 29f14e72
...@@ -477,7 +477,9 @@ new_msym(codegen_scope *s, mrb_sym sym) ...@@ -477,7 +477,9 @@ new_msym(codegen_scope *s, mrb_sym sym)
{ {
size_t i, len; size_t i, len;
if (s->irep == NULL) return 0;
len = s->irep->slen; len = s->irep->slen;
if (len > 256) len = 256; if (len > 256) len = 256;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
if (s->irep->syms[i] == sym) return i; if (s->irep->syms[i] == sym) return i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment