Skip to content

Commit f5a510d

Browse files
committed
Add some comments
1 parent 727e9d7 commit f5a510d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

source/vox/vm/interpret.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ private void pre_drop_stack_range(ref VmState vm, DroppedStackSlots dropped) {
389389
// Restore references from stackAllocs to stackAllocs
390390
changeLocalPointeeInRefs(vm, stackAllocs, 1, fromSlot, toSlot);
391391

392+
// This may be a false positive if allocations pointing to the stack are garbage
392393
return vm.setTrap(VmStatus.ERR_ESCAPED_PTR_TO_STACK_IN_MEM, i);
393394
}
394395

source/vox/vm/memory.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct Allocation {
6565
SizeAndAlign sizeAlign;
6666
// How many pointers to this allocation exist in other allocations
6767
// Pointers in registers do not increment the numInRefs
68+
// Only used to report escaped stack pointers
6869
u32 numInRefs;
6970

7071
static if (OUT_REFS_PER_ALLOCATION) {

0 commit comments

Comments
 (0)