Strictly speaking NULL + 0 is a undefined behavior; ref #5157

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-11-22 22:44:22 +09:00
parent 2d9bf22730
commit abdd006df3
2 changed files with 1267 additions and 1641 deletions
+7 -2
View File
@@ -6528,8 +6528,13 @@ mrb_parse_file_continue(mrb_state *mrb, FILE *f, const void *prebuf, size_t preb
p = mrb_parser_new(mrb);
if (!p) return NULL;
p->s = (const char *)prebuf;
p->send = (const char *)prebuf + prebufsize;
if (prebuf) {
p->s = (const char *)prebuf;
p->send = (const char *)prebuf + prebufsize;
}
else {
p->s = p->send = NULL;
}
p->f = f;
mrb_parser_parse(p, c);
File diff suppressed because it is too large Load Diff