From 3cac1b496d64b23bbbb2b5f1e6634fc35f177011 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 20 Feb 2022 15:35:18 +0200 Subject: [PATCH] Fixed addInfo for FuncCallInstr instruction --- source/tlang/compiler/codegen/instruction.d | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/codegen/instruction.d b/source/tlang/compiler/codegen/instruction.d index 6a10ac0a..b9773821 100644 --- a/source/tlang/compiler/codegen/instruction.d +++ b/source/tlang/compiler/codegen/instruction.d @@ -153,11 +153,25 @@ public class FuncCallInstr : CallInstr this.functionName = functionName; evaluationInstructions.length = argEvalInstrsSize; - addInfo = "FunctionName: "~functionName; + updateAddInfo(); + } + + /** + * FuncCallInstr is built-bit-by-bit so toString information will change + */ + private void updateAddInfo() + { + addInfo = "FunctionName: "~functionName ~" EvalInstrs: "~ to!(string)(getEvaluationInstructions()); } public void setEvalInstr(ulong argPos, Instruction instr) { evaluationInstructions[argPos] = instr; + updateAddInfo(); + } + + public Instruction[] getEvaluationInstructions() + { + return evaluationInstructions; } } \ No newline at end of file