improve warnings (#770)

This commit is contained in:
water111
2021-08-18 20:19:01 -04:00
committed by GitHub
parent 1214471fe7
commit e4f5e8eebd
3 changed files with 82 additions and 70 deletions
+5 -2
View File
@@ -910,11 +910,14 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
if (idx_of_success >= 0) {
auto& rd_ok = rd.results.at(idx_of_success);
auto stride_matcher = Matcher::match_or(
{Matcher::cast("uint", Matcher::integer(rd_in.stride)),
Matcher::cast("int", Matcher::integer(rd_in.stride)), Matcher::integer(rd_in.stride)});
auto arg1_matcher = Matcher::match_or(
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::MULTIPLICATION),
{Matcher::any(0), Matcher::integer(rd_in.stride)}),
{Matcher::any(0), stride_matcher}),
Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::MULTIPLICATION),
{Matcher::integer(rd_in.stride), Matcher::any(0)})});
{stride_matcher, Matcher::any(0)})});
auto match_result = match(arg1_matcher, args.at(1));
if (match_result.matched) {
bool used_index = false;