Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Issue 1182323011: Fix handling of TYPE_CODE_NUMENTRY record when size large. (Closed)

Created:
5 years, 6 months ago by Karl
Modified:
5 years, 6 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix handling of TYPE_CODE_NUMENTRY record when size large. Fixes how (very) large size entries in the TYPE_CODE_NUMENTRY is handled when reading bitcode. Makes sure that we con't call vector.resize() with too large a value (replacing an allocation exception with a parse error). Also tries to clean up type modeling of bitcode indices (references to values etc in the bitcode). Uses common type NaClBcIndexSize_t and NaClRelBcIndexSize_t (defined in nacl) to describe these (32-bit) values. Note: We use cast truncation of 64-bit values to NaClBcIndexSize_t and NaClRelBcIndexSize_t, since negative value indices are stored both as 32 and 64 bit values. The truncation cast handles this differences correctly (and efficiently). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4195 R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=74cd883a0b3ccb0920e5990ed860b1862ac73090

Patch Set 1 #

Patch Set 2 : Fix formatting. #

Total comments: 10

Patch Set 3 : Fix issues in patch set 2. #

Total comments: 4

Patch Set 4 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+263 lines, -101 lines) Patch
M Makefile.standalone View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/IceCompileServer.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/PNaClTranslator.cpp View 1 2 3 59 chunks +171 lines, -99 lines 0 comments Download
A unittest/IceParseTypesTest.cpp View 1 2 3 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
Karl
5 years, 6 months ago (2015-06-19 19:12:30 UTC) #2
Jim Stichnoth
https://codereview.chromium.org/1182323011/diff/20001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/1182323011/diff/20001/src/PNaClTranslator.cpp#newcode495 src/PNaClTranslator.cpp:495: // returns ICE::IceType_void. Ice::IceType_void https://codereview.chromium.org/1182323011/diff/20001/src/PNaClTranslator.cpp#newcode761 src/PNaClTranslator.cpp:761: NaClBcIndexSize_t NextTypeId = ...
5 years, 6 months ago (2015-06-21 00:33:42 UTC) #3
Karl
https://codereview.chromium.org/1182323011/diff/20001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/1182323011/diff/20001/src/PNaClTranslator.cpp#newcode495 src/PNaClTranslator.cpp:495: // returns ICE::IceType_void. On 2015/06/21 00:33:42, stichnot wrote: > ...
5 years, 6 months ago (2015-06-22 22:10:04 UTC) #4
Jim Stichnoth
lgtm https://codereview.chromium.org/1182323011/diff/40001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/1182323011/diff/40001/src/PNaClTranslator.cpp#newcode797 src/PNaClTranslator.cpp:797: uint64_t DefaultLargeResizeValue = 1000000; mark this const (or ...
5 years, 6 months ago (2015-06-22 22:48:09 UTC) #5
Karl
Committed patchset #4 (id:60001) manually as 74cd883a0b3ccb0920e5990ed860b1862ac73090 (presubmit successful).
5 years, 6 months ago (2015-06-23 18:05:05 UTC) #6
Karl
5 years, 6 months ago (2015-06-23 18:05:36 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/1182323011/diff/40001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/1182323011/diff/40001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:797: uint64_t DefaultLargeResizeValue = 1000000;
On 2015/06/22 22:48:09, stichnot wrote:
> mark this const (or better, constexpr)

Done.

https://codereview.chromium.org/1182323011/diff/40001/unittest/IceParseTypesT...
File unittest/IceParseTypesTest.cpp (right):

https://codereview.chromium.org/1182323011/diff/40001/unittest/IceParseTypesT...
unittest/IceParseTypesTest.cpp:1: //===- unittest/NaClParseTypesTest.cpp
------------------------------------===//
On 2015/06/22 22:48:09, stichnot wrote:
> You may want to add this file to FORMAT_BLACKLIST in Makefile.standalone. 
I.e.,
> add a new line:
> 
> FORMAT_BLACKLIST += ! -name NaClParseTypesTest.cpp

Done. Also fixed comment above.

Powered by Google App Engine
This is Rietveld 408576698