holey-bytes/hblang/examples/pointers.hb
2024-05-20 14:11:58 +02:00

18 lines
204 B
Plaintext

main := fn(): int {
a := 1;
b := &a;
modify(b);
drop(a);
stack_reclamation_edge_case := 0;
return *b - 2;
}
modify := fn(a: ^int): void {
*a = 2;
return;
}
drop := fn(a: int): void {
return;
}