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

This commit is contained in:
Jose Narvaez
2014-06-13 10:50:26 +01:00
parent 29f14e728d
commit e344d662f1
+2
View File
@@ -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;