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

Unified Diff: src/PNaClTranslator.cpp

Issue 848193003: Subzero: Add locking to prepare for multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 11 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 | « src/IceTranslator.cpp ('k') | no next file » | 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 beb4e22922f56d7001f6622b8887ed8cc5406925..a405d8b25c5425ad0f25cb390f5b87301283d89c 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -166,6 +166,11 @@ public:
: NaClBitcodeParser(Cursor), Translator(Translator), Header(Header),
ErrorStatus(ErrorStatus), NumErrors(0), NumFunctionIds(0),
NumFunctionBlocks(0), BlockParser(nullptr) {
+ // Note: This gives the reader uncontrolled access to the dump
+ // stream, which it can then use without locking. TODO(kschimpf):
+ // Consider reworking the LLVM side to use e.g. a callback for
+ // errors.
+ Ice::OstreamLocker L(Translator.getContext());
setErrStream(Translator.getContext()->getStrDump());
}
@@ -2814,8 +2819,7 @@ private:
Decl->setName(Trans.createUnnamedName(Prefix, NameIndex));
++NameIndex;
} else {
- Trans.checkIfUnnamedNameSafe(Decl->getName(), Context, Prefix,
- Trans.getContext()->getStrDump());
+ Trans.checkIfUnnamedNameSafe(Decl->getName(), Context, Prefix);
}
}
« no previous file with comments | « src/IceTranslator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698