Closed cd1m0 closed 3 years ago
To give more context, the issue here arises because of the way we interpose on function calls. Specifically we generate a wrapper that takes a function pointer, and pass it a function pointer to the original fun. This requires getting the argument and return types of the original function, or in this case public variable def, which requires the fixes in solc-typed-ast to support getting the arg/return types of an arbitrary public var.
This approach has another problem however - we introduce function pointers during instrumentation for contracts that didn't have function pointers before. Function pointers at the moment are problematic for certain SMT based verification backends (SMTCheck and solc-verify) with which we would like to integrate. Furthermore, there is no fundamental reason why we need to use function pointers during instrumentation here. Instead we can specialize the wrappers to the receiving contract/address and just pass that in. This would makes us play nicer with smt verification backends.
For the following sample:
Scribble crashes with the following stack:
We fail this assertion in
interposeCall
:Esentially the logic here doesn't handle the case when
calleeDef
is aVariableDeclaration
.Handling it correctly here first requires a fix in solc-typed-ast to get the expected argument and return types of a getter for an arbitrary public state var.