Unified · Split
| @@ -438,7 +438,7 @@ typedef struct TokenSym { · 437 unmodified lines | |||
| 438 | struct Sym *sym_identifier; /* direct pointer to identifier */ | 438 | struct Sym *sym_identifier; /* direct pointer to identifier */ |
| 439 | int tok; /* token number */ | 439 | int tok; /* token number */ |
| 440 | int len; | 440 | int len; |
| 441 | char str[1]; | 441 | char str[]; |
| 442 | } TokenSym; | 442 | } TokenSym; |
| 443 | 443 | ||
| 444 | #ifdef TCC_TARGET_PE | 444 | #ifdef TCC_TARGET_PE |
| @@ -490,7 +490,7 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) · 489 unmodified lines | |||
| 490 | table_ident = ptable; | 490 | table_ident = ptable; |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | ts = tal_realloc(&toksym_alloc, 0, sizeof(TokenSym) + len); | 493 | ts = tal_realloc(&toksym_alloc, 0, sizeof(TokenSym) + len + 1); |
| 494 | table_ident[i] = ts; | 494 | table_ident[i] = ts; |
| 495 | ts->tok = tok_ident++; | 495 | ts->tok = tok_ident++; |
| 496 | ts->sym_define = NULL; | 496 | ts->sym_define = NULL; |