Merge pull request #12227 from ethereum/smt_fix_gas

Fix ICE in CHC when using gas in the function options
This commit is contained in:
chriseth 2021-11-08 11:54:20 +01:00 committed by GitHub
commit f9ba1bf3c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -24,6 +24,7 @@ Bugfixes:
* Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them.
* Commandline Interface: When linking only accept exact matches for library names passed to the ``--libraries`` option. Library names not prefixed with a file name used to match any library with that name.
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
* SMTChecker: Fix internal error in the CHC engine when passing gas in the function options.
* TypeChecker: Fix internal error when using user defined value types in public library functions.
* TypeChecker: Fix internal error when using arrays and structs with user defined value types before declaration.
* TypeChecker: Improved error message for constant variables with (nested) mapping types.

View File

@ -791,8 +791,8 @@ void CHC::externalFunctionCall(FunctionCall const& _funCall)
valueIndex = i;
break;
}
solAssert(valueIndex, "");
state().addBalance(state().thisAddress(), 0 - expr(*callOptions->options().at(*valueIndex)));
if (valueIndex)
state().addBalance(state().thisAddress(), 0 - expr(*callOptions->options().at(*valueIndex)));
}
auto preCallState = vector<smtutil::Expression>{state().state()} + currentStateVariables();

View File

@ -0,0 +1,9 @@
library L {
function f() public view {
(bool success, ) = address(10).staticcall{gas: 3}("");
require(success);
}
}
// ====
// SMTEngine: all
// ----