OSDN Git Service

Fix pnacl-sz to not accept files containing multiple modules.
authorKarl Schimpf <kschimpf@google.com>
Tue, 22 Sep 2015 17:41:11 +0000 (10:41 -0700)
committerKarl Schimpf <kschimpf@google.com>
Tue, 22 Sep 2015 17:41:11 +0000 (10:41 -0700)
commit0b8763eae21d5d8952d401cf8e4dd7e4fe9b401d
tree4353308d043b722127fea83421df0137ba02778d
parent55f2e6d308e8a05dad706a6dd9c18a8f103e63c8
Fix pnacl-sz to not accept files containing multiple modules.

Previous code checked, after the fact, that there weren't multiple
modules in the block. However, the code for TopLevelParser assumes
that there is only on module block, allowing it to more efficiently
test internal state. To fix the problem, modified
TopLevelParser::ParseBlock to fail, and not attempt to parse the second
block if the file contains more than one block.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4260
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1362643002 .
src/PNaClTranslator.cpp
tests_lit/parse_errs/Inputs/multiple-modules.tbc [new file with mode: 0644]
tests_lit/parse_errs/multiple-modules.test [new file with mode: 0644]