From e70f23f9591998a803883de58d4b27311924624b Mon Sep 17 00:00:00 2001 From: pcc Date: Tue, 1 Sep 2015 21:55:07 -0700 Subject: [PATCH] Fix type errors in unit test utilities. Fixes all bad casts associated with operands of call and select operators in the test suite. Cleanup for cfi_vptr=1; see https://www.chromium.org/developers/testing/control-flow-integrity BUG=chromium:457523 R=bmeurer@chromium.org LOG=N Review URL: https://codereview.chromium.org/1329643002 Cr-Commit-Position: refs/heads/master@{#30531} --- test/unittests/compiler/node-test-utils.cc | 24 ++++++++++++------------ test/unittests/compiler/node-test-utils.h | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/unittests/compiler/node-test-utils.cc b/test/unittests/compiler/node-test-utils.cc index d401532..dc2bcb3 100644 --- a/test/unittests/compiler/node-test-utils.cc +++ b/test/unittests/compiler/node-test-utils.cc @@ -412,8 +412,8 @@ class IsSelectMatcher final : public NodeMatcher { bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { return (NodeMatcher::MatchAndExplain(node, listener) && - PrintMatchAndExplain(OpParameter(node), "type", - type_matcher_, listener) && + PrintMatchAndExplain(OpParameter(node).type(), + "type", type_matcher_, listener) && PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "value0", value0_matcher_, listener) && PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), @@ -641,7 +641,7 @@ class IsProjectionMatcher final : public NodeMatcher { class IsCallMatcher final : public NodeMatcher { public: - IsCallMatcher(const Matcher& descriptor_matcher, + IsCallMatcher(const Matcher& descriptor_matcher, const std::vector>& value_matchers, const Matcher& effect_matcher, const Matcher& control_matcher) @@ -670,8 +670,8 @@ class IsCallMatcher final : public NodeMatcher { bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { if (!NodeMatcher::MatchAndExplain(node, listener) || - !PrintMatchAndExplain(OpParameter(node), "descriptor", - descriptor_matcher_, listener)) { + !PrintMatchAndExplain(OpParameter(node), + "descriptor", descriptor_matcher_, listener)) { return false; } for (size_t i = 0; i < value_matchers_.size(); ++i) { @@ -690,7 +690,7 @@ class IsCallMatcher final : public NodeMatcher { } private: - const Matcher descriptor_matcher_; + const Matcher descriptor_matcher_; const std::vector> value_matchers_; const Matcher effect_matcher_; const Matcher control_matcher_; @@ -1618,7 +1618,7 @@ Matcher IsProjection(const Matcher& index_matcher, } -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& effect_matcher, @@ -1631,7 +1631,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, } -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -1646,7 +1646,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, } -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -1663,7 +1663,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, } -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -1682,7 +1682,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, } -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -1704,7 +1704,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, Matcher IsCall( - const Matcher& descriptor_matcher, + const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, const Matcher& value3_matcher, const Matcher& value4_matcher, const Matcher& value5_matcher, diff --git a/test/unittests/compiler/node-test-utils.h b/test/unittests/compiler/node-test-utils.h index 91f2174..5235d2f 100644 --- a/test/unittests/compiler/node-test-utils.h +++ b/test/unittests/compiler/node-test-utils.h @@ -99,25 +99,25 @@ Matcher IsEffectSet(const Matcher& effect0_matcher, const Matcher& effect1_matcher); Matcher IsProjection(const Matcher& index_matcher, const Matcher& base_matcher); -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, const Matcher& value3_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -125,7 +125,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value4_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); -Matcher IsCall(const Matcher& descriptor_matcher, +Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, @@ -135,7 +135,7 @@ Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); Matcher IsCall( - const Matcher& descriptor_matcher, + const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, const Matcher& value3_matcher, const Matcher& value4_matcher, const Matcher& value5_matcher, -- 2.7.4