string test_s337 array T_nextFree101 integer T_firstFree203 integer T_maxIndex342 array T_typeId146 string test_s337 = "" integer T_firstFree203 = 0 integer T_maxIndex342 = 0 function initGlobals608() { } function main264() { local integer t513 initGlobals608(); test_s_337 = ""; t_513 = new_A138(); dispatch_T_destroyT135(t_513); if (test_s_337 == "") { testSuccess448(); } else { }; } function config171() { } IS_NATIVE function testSuccess448() { } function new_A138() returns integer { local integer this436 local integer this850 if (T_firstFree_203 == 0) { if (T_maxIndex_342 < 32768) { T_maxIndex_342 = (T_maxIndex_342 + 1); this_850 = T_maxIndex_342; T_typeId_146[this_850] = 2; } else { error145("Out of memory: Could not create A."); this_850 = 0; }; } else { T_firstFree_203 = (T_firstFree_203 - 1); this_850 = T_nextFree_101[T_firstFree_203]; T_typeId_146[this_850] = 2; }; this_436 = this_850; return this_436; } function destroyB117(integer this162) { local integer obj863 test_s_337 = (test_s_337 + "B"); obj_863 = this_162; if (T_typeId_146[obj_863] == 0) { error145("Double free: object of type B"); } else { T_nextFree_101[T_firstFree_203] = obj_863; T_firstFree_203 = (T_firstFree_203 + 1); T_typeId_146[obj_863] = 0; }; } function error145(string msg206) { $debugPrint415((msg_206 + (" " + #getStackTrace()))); } function dispatch_T_destroyT135(integer this441) { local integer this123 local integer obj201 if (T_typeId_146[this_441] == 0) { if (this_441 == 0) { error145("Nullpointer exception when calling T.T"); } else { error145("Called T.T on invalid object."); }; } else { }; if (T_typeId_146[this_441] <= 2) { this_123 = this_441; obj_201 = this_123; if (T_typeId_146[obj_201] == 0) { error145("Double free: object of type T"); } else { T_nextFree_101[T_firstFree_203] = obj_201; T_firstFree_203 = (T_firstFree_203 + 1); T_typeId_146[obj_201] = 0; }; } else { destroyB117(this_441); }; }