OSDN Git Service

Fix processing of global variable indices in the global vars block.
authorKarl Schimpf <kschimpf@google.com>
Fri, 7 Aug 2015 16:28:57 +0000 (09:28 -0700)
committerKarl Schimpf <kschimpf@google.com>
Fri, 7 Aug 2015 16:28:57 +0000 (09:28 -0700)
commitaa0ce790f7426ad3be6e3c648ba84abbf1928378
treeb3ce73c2566f70a2b21df73fdb66ab376f872f72
parent9df4a379ebdb2f2200ec7f65017bd9fc8544794b
Fix processing of global variable indices in the global vars block.

The code used to use a vector to hold global variables associated with
indices. The problem was that the count record in the global vars
block would generate variables for the given count (even if very
large).

To fix this, we created a local unordered map to associate indices
with defined/referenced globals. After processing the global vars
block, this unordered map is used to verify the size makes sense, and
then install the recognized global variables into the (top-level)
contents.

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

Review URL: https://codereview.chromium.org/1278793006 .
src/PNaClTranslator.cpp