@@ -134,7 +134,7 @@ const interfaceManifest = {
134
134
DELEGATECALL : {
135
135
name : 'callDelegate' ,
136
136
async : true ,
137
- input : [ 'i32 ' , 'address' , 'i128' , ' readOffset' , 'length' , 'writeOffset ', 'length' ] ,
137
+ input : [ 'i64 ' , 'address' , 'readOffset' , 'length' ] ,
138
138
output : [ 'i32' ]
139
139
} ,
140
140
SSTORE : {
@@ -249,7 +249,7 @@ function generateManifest (interfaceManifest, opts) {
249
249
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 } )))
250
250
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 * 2 } )))
251
251
(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' ) {
253
253
call += `(call $check_overflow_i64
254
254
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 } )))
255
255
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 } )))
@@ -265,7 +265,7 @@ function generateManifest (interfaceManifest, opts) {
265
265
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 * 2 } )))
266
266
(i64.load (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 * 3 } )))))`
267
267
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' ) ) {
269
269
// CALLs in EVM have 7 arguments
270
270
// but in ewasm CALLs only have 5 arguments
271
271
// so delete the bottom two stack elements, after processing the 5th argument
@@ -302,7 +302,7 @@ function generateManifest (interfaceManifest, opts) {
302
302
(i64.store (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 * 2 } )) (i64.const 0))
303
303
(i64.store (i32.add (get_global $sp) (i32.const ${ spOffset * 32 + 8 * 1 } )) (i64.const 0))`
304
304
305
- } else if ( input === 'length' && ( opcode !== 'CALL' && opcode !== 'CALLCODE' ) ) {
305
+ } else if ( input === 'length' ) {
306
306
locals += `(local $length${ numOfLocals } i32)`
307
307
body += `(set_local $length${ numOfLocals }
308
308
(call $check_overflow
0 commit comments