File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,21 @@ void ConstantFunctionEvaluator::operator()(FunctionDefinition& _function)
96
96
Block newBody;
97
97
newBody.debugData = _function.body .debugData ;
98
98
99
+ // After the execution, all debug data got swept away. To still maintain
100
+ // useful information, we assign the literal debug data with the debug data
101
+ // of the function itself.
102
+ // One case this assignment is helpful is in the case of function with only
103
+ // one return variable. In this case, it would likely be a solidity
104
+ // constant.
105
+ langutil::DebugData::ConstPtr literalDebugData = _function.debugData ;
106
+
99
107
for (auto const & retVar: _function.returnVariables )
100
108
{
101
109
Identifier ident;
102
110
ident.name = retVar.name ;
103
111
104
112
Literal val;
113
+ val.debugData = literalDebugData;
105
114
val.kind = LiteralKind::Number;
106
115
val.type = retVar.type ;
107
116
val.value = LiteralValue (interpreter.valueOfVariable (retVar.name ));
You can’t perform that action at this time.
0 commit comments