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/IceCfg.cpp

Issue 1306713002: Fix bug in the call to random number generator in Cfg's ctor (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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/llvm2ice_tests/randomize-pool-immediate-basic.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index cc6d07c0e1bbba9c06406ac7e126e8ac6a2d7a66..cf7be3b1f9a791c14cb3a4168ba68cdf0779f904 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -43,15 +43,13 @@ Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber)
VMetadata(new VariablesMetadata(this)),
TargetAssembler(TargetLowering::createAssembler(
Ctx->getFlags().getTargetArch(), this)) {
- assert(!Ctx->isIRGenerationDisabled() &&
- "Attempt to build cfg when IR generation disabled");
if (Ctx->getFlags().getRandomizeAndPoolImmediatesOption() == RPI_Randomize) {
// If -randomize-pool-immediates=randomize, create a random number generator
// to generate a cookie for constant blinding.
RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(),
- RPE_ConstantBlinding, SequenceNumber);
+ RPE_ConstantBlinding, this->SequenceNumber);
Jim Stichnoth 2015/08/21 00:12:31 I think you can drop the "this->", right?
ConstantBlindingCookie =
- (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max + 1);
+ (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max() + 1);
}
}
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/randomize-pool-immediate-basic.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698