string test_s104 array T_nextFree358 integer T_firstFree142 integer T_maxIndex303 array T_typeId124 string test_s104 = "" integer T_firstFree142 = 0 integer T_maxIndex303 = 0 function initGlobals253() { } function main106() { initGlobals253(); test_s_104 = ""; dispatch_T_destroyT181(new_A122()); if (test_s_104 == "") { testSuccess466(); } else { }; } function config115() { } IS_NATIVE function testSuccess466() { } function new_A122() returns integer { local integer this117 if (T_firstFree_142 == 0) { if (T_maxIndex_303 < 32768) { T_maxIndex_303 = (T_maxIndex_303 + 1); this_117 = T_maxIndex_303; T_typeId_124[this_117] = 2; } else { error161("Out of memory: Could not create A."); this_117 = 0; }; } else { T_firstFree_142 = (T_firstFree_142 - 1); this_117 = T_nextFree_358[T_firstFree_142]; T_typeId_124[this_117] = 2; }; return this_117; } function destroyB133(integer this493) { test_s_104 = (test_s_104 + "B"); if (T_typeId_124[this_493] == 0) { error161("Double free: object of type B"); } else { T_nextFree_358[T_firstFree_142] = this_493; T_firstFree_142 = (T_firstFree_142 + 1); T_typeId_124[this_493] = 0; }; } function error161(string msg598) { $debugPrint149((msg_598 + (" " + #getStackTrace()))); } function dispatch_T_destroyT181(integer this196) { if (T_typeId_124[this_196] == 0) { if (this_196 == 0) { error161("Nullpointer exception when calling T.T"); } else { error161("Called T.T on invalid object."); }; } else { }; if (T_typeId_124[this_196] <= 2) { if (T_typeId_124[this_196] == 0) { error161("Double free: object of type T"); } else { T_nextFree_358[T_firstFree_142] = this_196; T_firstFree_142 = (T_firstFree_142 + 1); T_typeId_124[this_196] = 0; }; } else { destroyB133(this_196); }; }