@@ -119,16 +119,12 @@ void generateStackAllocFunction(LinkerObject& linker) {
119119 SetLocal* setStackLocal = builder.makeSetLocal (1 , loadStack);
120120 GetLocal* getStackLocal = builder.makeGetLocal (1 , i32 );
121121 GetLocal* getSizeArg = builder.makeGetLocal (0 , i32 );
122- Binary* add = builder.makeBinary (AddInt32 , getStackLocal, getSizeArg);
122+ Binary* sub = builder.makeBinary (SubInt32 , getStackLocal, getSizeArg);
123123 const static uint32_t bitAlignment = 16 ;
124124 const static uint32_t bitMask = bitAlignment - 1 ;
125- Const* addConst = builder.makeConst (Literal (bitMask));
126- Binary* maskedAdd = builder.makeBinary (
127- AndInt32,
128- builder.makeBinary (AddInt32, add, addConst),
129- builder.makeConst (Literal (~bitMask))
130- );
131- Store* storeStack = generateStoreStackPointer (builder, linker, maskedAdd);
125+ Const* subConst = builder.makeConst (Literal (~bitMask));
126+ Binary* maskedSub = builder.makeBinary (AndInt32, sub, subConst);
127+ Store* storeStack = generateStoreStackPointer (builder, linker, maskedSub);
132128
133129 Block* block = builder.makeBlock ();
134130 block->list .push_back (setStackLocal);
0 commit comments