Skip to content

Commit

Permalink
Merge pull request #65 from unyt-org/fix-pointer-property-dependencies
Browse files Browse the repository at this point in the history
Fix pointer property dependencies
  • Loading branch information
benStre authored Jan 24, 2024
2 parents 6f1da44 + 61b5c57 commit 3dadca0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>|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);
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 3dadca0

Please sign in to comment.