File tree 1 file changed +9
-14
lines changed
1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -97,21 +97,19 @@ private:
97
97
stack_unwind(this .stack, frame.sp, frame.arity);
98
98
},
99
99
(I32Store i32store) {
100
- const value_ = this .stack.back;
101
- this .stack.popBack();
102
- const valueAddr = this .stack.back;
100
+ const value = this .stack.back.match! (
101
+ (I32 i32) => i32.i,
102
+ _ => assert (false )
103
+ );
103
104
this .stack.popBack();
104
- const addr = cast ( size_t ) valueAddr .match! (
105
- (I32 value) => value.i,
105
+ const addr = this .stack.back .match! (
106
+ (I32 value) => size_t ( value.i) ,
106
107
_ => assert (false )
107
108
);
108
- const offset = cast (size_t ) i32store.offset;
109
+ this .stack.popBack();
110
+ const offset = size_t (i32store.offset);
109
111
const at = addr + offset;
110
112
auto memory = this .store.memories[0 ];
111
- const int value = value_.match! (
112
- (I32 i32) => i32.i,
113
- _ => assert (false )
114
- );
115
113
memory.data.write! (int , Endian.littleEndian)(value, at);
116
114
},
117
115
(I32Const i32const) {
@@ -283,10 +281,7 @@ public:
283
281
(binary.types.Func func) => func.idx
284
282
);
285
283
const funcInst = this .store.funcs[idx];
286
- foreach (arg; args)
287
- {
288
- this .stack ~= arg;
289
- }
284
+ this .stack ~= args;
290
285
return funcInst.match! (
291
286
(InternalFuncInst func) => invokeInternal(func),
292
287
(ExternalFuncInst func) => invokeExternal(func),
You can’t perform that action at this time.
0 commit comments