File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -4824,7 +4824,11 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
4824
4824
return funcFlow;
4825
4825
}
4826
4826
// Create a new continuation for the target function.
4827
- Name funcName = funcFlow.getSingleValue ().getFunc ();
4827
+ auto funcValue = funcFlow.getSingleValue ();
4828
+ if (funcValue.isNull ()) {
4829
+ trap (" null ref" );
4830
+ }
4831
+ auto funcName = funcValue.getFunc ();
4828
4832
auto * func = self ()->getModule ()->getFunction (funcName);
4829
4833
return Literal (std::make_shared<ContData>(
4830
4834
self ()->makeFuncData (func->name , func->type ), curr->type .getHeapType ()));
Original file line number Diff line number Diff line change 117
117
(call $nl4 (cont.new $k1 (ref.func $r1 )))
118
118
)
119
119
120
- (func (export " null" )
120
+ (func (export " null-resume " )
121
121
(resume $k1
122
122
(ref.null $k1 )
123
123
)
124
124
)
125
+
126
+ (func (export " null-new" ) (result (ref null $k1 ))
127
+ (cont.new $k1
128
+ (ref.null $f1 )
129
+ )
130
+ )
125
131
)
126
132
127
133
(assert_suspension (invoke " unhandled-1" ) " unhandled" )
138
144
(assert_trap (invoke " non-linear-3" ) " continuation already consumed" )
139
145
(assert_trap (invoke " non-linear-4" ) " continuation already consumed" )
140
146
141
- (assert_trap (invoke " null" ) " null continuation reference" )
147
+ (assert_trap (invoke " null-resume" ) " null continuation reference" )
148
+ (assert_trap (invoke " null-new" ) " null function reference" )
142
149
143
150
(assert_invalid
144
151
(module
You can’t perform that action at this time.
0 commit comments