|
|
@ -8,7 +8,7 @@ function TraceStepManager (_traceAnalyser) { |
|
|
|
|
|
|
|
|
|
|
|
TraceStepManager.prototype.isCallInstruction = function (index) { |
|
|
|
TraceStepManager.prototype.isCallInstruction = function (index) { |
|
|
|
var state = this.traceAnalyser.trace[index] |
|
|
|
var state = this.traceAnalyser.trace[index] |
|
|
|
return traceHelper.isCallInstruction(state) |
|
|
|
return traceHelper.isCallInstruction(state) && !traceHelper.isCallToPrecompiledContract(index, this.traceAnalyser.trace) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TraceStepManager.prototype.isReturnInstruction = function (index) { |
|
|
|
TraceStepManager.prototype.isReturnInstruction = function (index) { |
|
|
@ -17,8 +17,9 @@ TraceStepManager.prototype.isReturnInstruction = function (index) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TraceStepManager.prototype.findStepOverBack = function (currentStep) { |
|
|
|
TraceStepManager.prototype.findStepOverBack = function (currentStep) { |
|
|
|
if (this.isReturnInstruction(currentStep - 1)) { |
|
|
|
if (this.isReturnInstruction(currentStep)) { |
|
|
|
return this.traceAnalyser.traceCache.calls[currentStep].call - 1 |
|
|
|
var call = util.findCall(currentStep, this.traceAnalyser.traceCache.callsTree.call) |
|
|
|
|
|
|
|
return call.start > 0 ? call.start - 1 : 0 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return currentStep > 0 ? currentStep - 1 : 0 |
|
|
|
return currentStep > 0 ? currentStep - 1 : 0 |
|
|
|
} |
|
|
|
} |
|
|
@ -26,7 +27,8 @@ TraceStepManager.prototype.findStepOverBack = function (currentStep) { |
|
|
|
|
|
|
|
|
|
|
|
TraceStepManager.prototype.findStepOverForward = function (currentStep) { |
|
|
|
TraceStepManager.prototype.findStepOverForward = function (currentStep) { |
|
|
|
if (this.isCallInstruction(currentStep)) { |
|
|
|
if (this.isCallInstruction(currentStep)) { |
|
|
|
return this.traceAnalyser.traceCache.calls[currentStep + 1].return |
|
|
|
var call = util.findCall(currentStep + 1, this.traceAnalyser.traceCache.callsTree.call) |
|
|
|
|
|
|
|
return call.return + 1 < this.traceAnalyser.trace.length ? call.return + 1 : this.traceAnalyser.trace.length - 1 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return this.traceAnalyser.trace.length >= currentStep + 1 ? currentStep + 1 : currentStep |
|
|
|
return this.traceAnalyser.trace.length >= currentStep + 1 ? currentStep + 1 : currentStep |
|
|
|
} |
|
|
|
} |
|
|
|