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

Unified Diff: src/PNaClTranslator.cpp

Issue 1345293002: Don't allow multiple symbol tables in the module block. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/dup-module-vst.tbc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index d8d1860f1ef760bf1ac5bda1b21f5cb964562d9e..f9aa2aa3d667f197292498e8cee6c71c5ec8d913 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -2950,6 +2950,8 @@ private:
// True if we have already installed names for unnamed global declarations,
// and have generated global constant initializers.
bool GlobalDeclarationNamesAndInitializersInstalled = false;
+ // True if we have already processed the symbol table for the module.
+ bool FoundValuesymtab = false;
// Generates names for unnamed global addresses (i.e. functions and global
// variables). Then lowers global variable declaration initializers to the
@@ -2959,7 +2961,10 @@ private:
if (!GlobalDeclarationNamesAndInitializersInstalled) {
Context->installGlobalNames();
Context->createValueIDs();
- getTranslator().lowerGlobals(Context->getGlobalVariables());
+ std::unique_ptr<Ice::VariableDeclarationList> Globals =
+ Context->getGlobalVariables();
+ if (Globals)
+ getTranslator().lowerGlobals(std::move(Globals));
GlobalDeclarationNamesAndInitializersInstalled = true;
}
}
@@ -3017,6 +3022,10 @@ bool ModuleParser::ParseBlock(unsigned BlockID) {
return Parser.ParseThisBlock();
}
case naclbitc::VALUE_SYMTAB_BLOCK_ID: {
+ if (FoundValuesymtab)
+ Fatal("Duplicate valuesymtab in module");
+
+ FoundValuesymtab = true;
ModuleValuesymtabParser Parser(BlockID, this);
return Parser.ParseThisBlock();
}
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/dup-module-vst.tbc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698