Skip to content

Large contract does not compile using the Revive WASM version on linux platform with Bun #149

Open
@smiasojed

Description

@smiasojed

Contract: https://github.com/paritytech/js-revive/blob/main/fixtures/token.sol?plain=1

Output:

~/github/js-revive main 8s
❯ bun src/main.ts
4 |   if (typeof __filename != 'undefined') _scriptName ||= __filename;
5 |   return (
6 | function(moduleArg = {}) {
7 |   var moduleRtn;
8 |
9 | var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){}var Module={stdinData:null,stdinDataPosition:0,stdoutData:[],stderrData:[],readFromStdout:function(){if(!this.stdoutData.length)return"";const decoder=new TextDecoder("utf-8");const data=decoder.decode(new Uint8Array(this.stdoutData));this.stdoutData=[];return data},readFromStderr:function(){if(!this.stderrData.length)return"";const decoder=new TextDecoder("utf-8");const data=decoder.decode(new Uint8Array(this.stderrData));this.stderrData=[];return data},writeToStdin:function(data){const encoder=new TextEncoder;this.stdinData=encoder.encode(data);this.stdinDataPosition=0},preRun:function(){func | ... truncated

RuntimeError: Out of bounds memory access (evaluating 'getWasmTableEntry(index)(a1, a2, a3, a4, a5)')
      at <?>.wasm-function[126]
      at <?>.wasm-function[268]
      at <?>.wasm-function[10349]
      at <?>.wasm-function[33862]
      at <?>.wasm-function[6911]
      at <?>.wasm-function[22493]
      at invoke_viiiii (/home/pg/github/js-revive/src/resolc/resolc.js:9:83191)
      at <?>.wasm-function[22451]
      at invoke_viiii (/home/pg/github/js-revive/src/resolc/resolc.js:9:82330)
      at <?>.wasm-function[28280]

Expected result: Contract is compiled without errors

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions