Fix ICE in CHC when using gas in the function options

This commit is contained in:
Leo Alt 2021-11-03 15:40:54 +01:00
parent e40cf92b1d
commit dff280cadc
3 changed files with 12 additions and 2 deletions

View File

@ -23,6 +23,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
// ----