From 32cd40ec3c9dad33738caf6f55fb742a316bd5be Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Jul 2015 12:51:32 -0700 Subject: 1799 - continue to debug memory corruption of 1795 Things I figured out: - 'row' in render-screen doesn't perfectly track cursor-row in screen - proximal cause was forgetting to add left:number to stop-printing - trying to print to screen outside bounds was silently succeeding and corrupting simulated memory - if we silently ignore prints outside bounds things are fine But why are prints outside screen bounds working? We should be accessing screen data using 'index', and that's checking its bounds. --- 044space.cc | 1 + 1 file changed, 1 insertion(+) (limited to '044space.cc') diff --git a/044space.cc b/044space.cc index 4469e47f..40f0f5ba 100644 --- a/044space.cc +++ b/044space.cc @@ -178,6 +178,7 @@ void try_reclaim_locals() { if (inst.name != "local-scope") return; //? cerr << inst.to_string() << '\n'; //? 1 +//? cerr << current_recipe_name() << ": abandon " << Current_routine->calls.front().default_space << '\n'; //? 1 abandon(Current_routine->calls.front().default_space, /*array length*/1+/*number-of-locals*/Name[r][""]); } -- cgit 1.4.1-2-gfad0