Skip to content

Commit 35269c7

Browse files
[WASM] Update assertion condition for keypath projector
1 parent 7be312c commit 35269c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILOptimizer/Utils/KeyPathProjector.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ class GettablePropertyProjector : public ComponentProjector {
230230
auto addr = builder.createAllocStack(loc, type);
231231

232232
assertHasNoContext();
233-
assert(getter->getArguments().size() == 2);
233+
// For wasm, SILGen emit keypath projecter with extra generic param
234+
// argument to match callee and caller signature even if it doesn't
235+
// have generic param.
236+
auto target = builder.getASTContext().LangOpts.Target;
237+
assert(getter->getArguments().size() == 2 + target.isOSBinFormatWasm());
234238

235239
auto ref = builder.createFunctionRef(loc, getter);
236240
builder.createApply(loc, ref, subs, {addr, parentValue});

0 commit comments

Comments
 (0)