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

This commit is contained in:
Jose Narvaez
2014-06-13 10:50:15 +01:00
parent a5cadf4bec
commit 29f14e728d
+4 -2
View File
@@ -446,8 +446,10 @@ new_lit(codegen_scope *s, mrb_value val)
s->irep->pool = (mrb_value *)codegen_realloc(s, s->irep->pool, sizeof(mrb_value)*s->pcapa);
}
pv = &s->irep->pool[s->irep->plen];
i = s->irep->plen++;
if (&s->irep->pool[s->irep->plen] != NULL) {
pv = &s->irep->pool[s->irep->plen];
i = s->irep->plen++;
}
switch (mrb_type(val)) {
case MRB_TT_STRING: