History

Fix overrun in decl_initializer_alloc.

This bug was reported on http://lists.gnu.org/archive/html/tinycc-devel/2009-03/msg00035.html This happens because parser of array initializer doesn't stop to read until semi-colon or comma.

Shinichiro Hamaji committed 17 years ago

Commit af6cbc41 parent 040ef001 file · +4 −2Browse files

Unified · Split

tcc.c+4−2
@@ -9176,9 +9176,11 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 9175 unmodified lines
91769176 if (tok == '{')
91779177 level++;
91789178 else if (tok == '}') {
9179− if (level == 0)
9180− break;
91819179 level--;
9180+ if (level <= 0) {
9181+ next();
9182+ break;
9183+ }
91829184 }
91839185 next();
91849186 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t