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

Unified Diff: src/deoptimizer.cc

Issue 1058533007: Fix a few potential integer negation overflows (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 075a51f95999a1c8a59a21e589b16ce6f0d63d2c..227f23859f2735d358a6a3aebf1c06fd3480474e 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -2899,6 +2899,8 @@ Object* FrameDescription::GetExpression(int index) {
void TranslationBuffer::Add(int32_t value, Zone* zone) {
+ // This wouldn't handle kMinInt correctly if it ever encountered it.
+ DCHECK(value != kMinInt);
// Encode the sign bit in the least significant bit.
bool is_negative = (value < 0);
uint32_t bits = ((is_negative ? -value : value) << 1) |

Powered by Google App Engine
This is Rietveld 408576698