From 18ebe6e6ca4299b7f903426502c5a5fb73747c81 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Mon, 27 Dec 2021 22:32:32 +0100 Subject: ... --- src/Tonkadur/Compute.elm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Tonkadur/Compute.elm') diff --git a/src/Tonkadur/Compute.elm b/src/Tonkadur/Compute.elm index 489ab3b..2a3410f 100644 --- a/src/Tonkadur/Compute.elm +++ b/src/Tonkadur/Compute.elm @@ -160,7 +160,10 @@ newline : Tonkadur.Types.State -> Tonkadur.Types.Value newline state = (TextValue Newline) next_allocable_address : Tonkadur.Types.State -> Tonkadur.Types.Value -next_allocable_address state = (IntValue state.next_allocable_address) +next_allocable_address state = + if (List.isEmpty state.freed_addresses) + then (PointerValue [(".alloc." ++ (String.fromInt state.allocated_data))]) + else (PointerValue [state.freed_addresses[0]]) operation : ( Tonkadur.Types.State -> -- cgit v1.2.3-70-g09d2