@@ -134,7 +134,7 @@ const interfaceManifest = {
134134  DELEGATECALL : { 
135135    name : 'callDelegate' , 
136136    async : true , 
137-     input : [ 'i32 ' ,  'address' ,  'i128'  ,   ' readOffset' ,   'length' ,   'writeOffset ',  'length' ] , 
137+     input : [ 'i64 ' ,  'address' ,  'readOffset' ,  'length' ] , 
138138    output : [ 'i32' ] 
139139  } , 
140140  SSTORE : { 
@@ -249,7 +249,7 @@ function generateManifest (interfaceManifest, opts) {
249249           (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8 }  ))) 
250250           (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  2 }  ))) 
251251           (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  3 }  ))))` 
252-       }  else  if  ( input  ===  'i64'   &&   opcode   !==   'CALL' )  { 
252+       }  else  if  ( input  ===  'i64' )  { 
253253        call  +=  `(call $check_overflow_i64 
254254           (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32 }  ))) 
255255           (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8 }  ))) 
@@ -265,7 +265,7 @@ function generateManifest (interfaceManifest, opts) {
265265      (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  2 }  ))) 
266266      (i64.load (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  3 }  )))))` 
267267        call  +=  `(get_local $offset${ numOfLocals }  )` 
268-       }  else  if  ( input  ===  'length'  &&  ( opcode  ===  'CALL'  ||  opcode  ===  'CALLCODE' ) )  { 
268+       }  else  if  ( input  ===  'length'  &&  ( opcode  ===  'CALL'  ||  opcode  ===  'CALLCODE'   ||   opcode   ===   'DELEGATECALL' ) )  { 
269269        // CALLs in EVM have 7 arguments 
270270        // but in ewasm CALLs only have 5 arguments 
271271        // so delete the bottom two stack elements, after processing the 5th argument 
@@ -302,7 +302,7 @@ function generateManifest (interfaceManifest, opts) {
302302      (i64.store (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  2 }  )) (i64.const 0)) 
303303      (i64.store (i32.add (get_global $sp) (i32.const ${ spOffset  *  32  +  8  *  1 }  )) (i64.const 0))` 
304304
305-       }  else  if  ( input  ===  'length'   &&   ( opcode   !==   'CALL'   &&   opcode   !==   'CALLCODE' ) )  { 
305+       }  else  if  ( input  ===  'length' )  { 
306306        locals  +=  `(local $length${ numOfLocals }   i32)` 
307307        body  +=  `(set_local $length${ numOfLocals }    
308308    (call $check_overflow  
0 commit comments