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
9176 if (tok == '{')9176 if (tok == '{')
9177 level++;9177 level++;
9178 else if (tok == '}') {9178 else if (tok == '}') {
9179 if (level == 0)
9180 break;
9181 level--;9179 level--;
9180 if (level <= 0) {
9181 next();
9182 break;
9183 }
9182 }9184 }
9183 next();9185 next();
9184 }9186 }

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