Reviewers: Benedikt Meurer,

Description:
Use correct template parameters when casting RHS of operator comparison.

Failing to use the correct Pred and Hash parameters results in an invalid
cast for operators with custom Pred and Hash parameters, e.g. double.

Cleanup for cfi_vptr=1; see
https://www.chromium.org/developers/testing/control-flow-integrity

BUG=chromium:457523
[email protected]

Please review this at https://codereview.chromium.org/1309903005/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+1, -1 lines):
  M src/compiler/operator.h


Index: src/compiler/operator.h
diff --git a/src/compiler/operator.h b/src/compiler/operator.h
index 5b15b9728916dc76aaeea209e0cdefcdf6e511f4..ef30f9e90eb88e84cd8a9782728600499a2105d9 100644
--- a/src/compiler/operator.h
+++ b/src/compiler/operator.h
@@ -155,7 +155,7 @@ class Operator1 : public Operator {

   bool Equals(const Operator* other) const final {
     if (opcode() != other->opcode()) return false;
- const Operator1<T>* that = reinterpret_cast<const Operator1<T>*>(other);
+    auto* that = reinterpret_cast<const Operator1<T, Pred, Hash>*>(other);
     return this->pred_(this->parameter(), that->parameter());
   }
   size_t HashCode() const final {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to