mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fixed dereference to null pointer in 'codegen.c' reported by 'clang-analyzer'
This commit is contained in:
@@ -477,7 +477,9 @@ new_msym(codegen_scope *s, mrb_sym sym)
|
||||
{
|
||||
size_t i, len;
|
||||
|
||||
if (s->irep == NULL) return 0;
|
||||
len = s->irep->slen;
|
||||
|
||||
if (len > 256) len = 256;
|
||||
for (i=0; i<len; i++) {
|
||||
if (s->irep->syms[i] == sym) return i;
|
||||
|
||||
Reference in New Issue
Block a user