summaryrefslogtreecommitdiff
path: root/src/ir/cost.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-19 16:03:01 -0700
committerGitHub <noreply@github.com>2022-07-19 16:03:01 -0700
commit1c53f7dd29e79bc1894959cad817b22f087689f7 (patch)
treec3d114a3359f4ba9175f7cff3bf3bc6b83c2b885 /src/ir/cost.h
parent984078acc7625c44870a3d256deaa19b76894de0 (diff)
downloadbinaryen-1c53f7dd29e79bc1894959cad817b22f087689f7.tar.gz
binaryen-1c53f7dd29e79bc1894959cad817b22f087689f7.tar.bz2
binaryen-1c53f7dd29e79bc1894959cad817b22f087689f7.zip
[Strings] Add string.new GC variants (#4813)
Diffstat (limited to 'src/ir/cost.h')
-rw-r--r--src/ir/cost.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 8ebc6eb9b..b48b777e1 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -672,7 +672,7 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
}
CostType visitRefAs(RefAs* curr) { return 1 + visit(curr->value); }
CostType visitStringNew(StringNew* curr) {
- return 8 + visit(curr->ptr) + visit(curr->length);
+ return 8 + visit(curr->ptr) + maybeVisit(curr->length);
}
CostType visitStringConst(StringConst* curr) { return 4; }
CostType visitStringMeasure(StringMeasure* curr) {