diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index cd9acd3ce1..04a4cf0700 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -27,6 +27,7 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, .click('*[data-id="treeViewDivcompiler"]') .waitForElementVisible('*[data-id="treeViewLicompiler/version"]') .assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`) + .modalFooterCancelClick() .perform(done) } else done() }) diff --git a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts index 7e88161867..3da83f59c6 100644 --- a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts @@ -52,6 +52,16 @@ module.exports = { .pause(5000) .addFile('test_updateConfiguration.sol', { content: simpleContract }) .verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' }) + }, + + 'Should produce a stack too deep error': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('fileExplorers') + .click('li[data-id="treeViewLitreeViewItemREADME.txt"') + .addFile('ContractStackLimit.sol', { content: contractStackLimit }) + .clickLaunchIcon('solidity') + .pause(10000) + .waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.') .end() }, @@ -156,3 +166,12 @@ const updateConfiguration = `(async () => { console.log(e.message) } })()` + +const contractStackLimit = ` +//SPDX-License-Identifier: MIT +pragma solidity >=0.4.22 <0.9.1; +contract DoesNotCompile { + uint u; + function fStackLimit(uint u1, uint u2, uint u3, uint u4, uint u5, uint u6, uint u7, uint u8, uint u9, uint u10, uint u11, uint u12) public { + } +}` diff --git a/apps/remix-ide/src/app/ui/renderer.js b/apps/remix-ide/src/app/ui/renderer.js index 89564c769e..21b98fbd85 100644 --- a/apps/remix-ide/src/app/ui/renderer.js +++ b/apps/remix-ide/src/app/ui/renderer.js @@ -112,7 +112,7 @@ Renderer.prototype.error = function (message, container, opt) { // Updated error reported includes '-->' before file details const errorDetails = text.split('-->') // errorDetails[1] will have file details - position = getPositionDetails(errorDetails[1]) + if (errorDetails.length > 1) position = getPositionDetails(errorDetails[1]) } opt.errLine = position.errLine