From 61b5c573c228b09ffd1ae6e3dc6e2709d3759523 Mon Sep 17 00:00:00 2001 From: benStre Date: Wed, 24 Jan 2024 23:24:45 +0100 Subject: [PATCH] add pointer property pointers as compile dependencies --- compiler/compiler.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/compiler.ts b/compiler/compiler.ts index 7f5a27f8..f60231fd 100644 --- a/compiler/compiler.ts +++ b/compiler/compiler.ts @@ -2300,6 +2300,9 @@ export class Compiler { addPointer: (p:Pointer, SCOPE:compiler_scope|extract_var_scope, action_type:ACTION_TYPE = ACTION_TYPE.GET, action_specifier?:BinaryCode):Promise|void => { + // pointer get + if (SCOPE.options.inserted_ptrs && action_type == ACTION_TYPE.GET) SCOPE.options.inserted_ptrs.add(p) + // ignore value - insert void if (p.value_initialized && p.val?.[DX_IGNORE]) { Compiler.builder.addVoid(SCOPE); @@ -2981,14 +2984,9 @@ export class Compiler { action_type = ACTION_TYPE.OTHER; action_specifier = BinaryCode.CREATE_POINTER; } - else { - // pointer get - if (SCOPE.options.inserted_ptrs) SCOPE.options.inserted_ptrs.add(value) - } Compiler.builder.addPointer(value, SCOPE, action_type, action_specifier); // POINTER (assignment) } else { - if (SCOPE.options.inserted_ptrs) SCOPE.options.inserted_ptrs.add(value) Compiler.builder.addPointer(value, SCOPE); // POINTER } }