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

Unified Diff: src/IceSwitchLowering.h

Issue 1460003003: Fix race condition in jump table list creation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 1 month 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/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceSwitchLowering.h
diff --git a/src/IceSwitchLowering.h b/src/IceSwitchLowering.h
index 8ac1842ca8f07c613173ad853185f378f4cfafa0..a6ae9a9cb512643b13728727926a67a502b4db53 100644
--- a/src/IceSwitchLowering.h
+++ b/src/IceSwitchLowering.h
@@ -81,10 +81,10 @@ class JumpTableData {
JumpTableData &operator=(const JumpTableData &) = delete;
public:
- JumpTableData(IceString FuncName, SizeT Id, SizeT NumTargets)
- : FuncName(FuncName), Id(Id) {
- TargetOffsets.reserve(NumTargets);
- }
+ using TargetList = std::vector<intptr_t>;
+
+ JumpTableData(IceString FuncName, SizeT Id, const TargetList &TargetOffsets)
Jim Stichnoth 2015/11/20 01:02:20 const IceString &FuncName
sehr 2015/11/20 05:43:15 Done.
+ : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) { }
JumpTableData(const JumpTableData &) = default;
JumpTableData(JumpTableData &&) = default;
JumpTableData &operator=(JumpTableData &&) = default;
@@ -93,14 +93,14 @@ public:
const IceString &getFunctionName() const { return FuncName; }
SizeT getId() const { return Id; }
- const std::vector<intptr_t> &getTargetOffsets() const {
+ const TargetList &getTargetOffsets() const {
return TargetOffsets;
}
private:
IceString FuncName;
Jim Stichnoth 2015/11/20 01:02:20 Can this be const IceString?
sehr 2015/11/20 05:43:15 Looks like move operations don't work if I do this
SizeT Id;
- std::vector<intptr_t> TargetOffsets;
+ TargetList TargetOffsets;
};
using JumpTableDataList = std::vector<JumpTableData>;
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698