array A_nextFree400 integer A_firstFree466 integer A_maxIndex136 array A_typeId190 integer A_firstFree466 = 0 integer A_maxIndex136 = 0 function initGlobals585() { } function main149() { initGlobals585(); init_test110(); } function config197() { } function init_test110() { local integer b429 b_429 = new_B149(); if (A_typeId_190[b_429] == 0) { if (b_429 == 0) { error124("Nullpointer exception when calling A.foo"); } else { error124("Called A.foo on invalid object."); }; } else { }; testSuccess210(); } IS_NATIVE function testSuccess210() { } function new_B149() returns integer { local integer this483 if (A_firstFree_466 == 0) { if (A_maxIndex_136 < 32768) { A_maxIndex_136 = (A_maxIndex_136 + 1); this_483 = A_maxIndex_136; A_typeId_190[this_483] = 2; } else { error124("Out of memory: Could not create B."); this_483 = 0; }; } else { A_firstFree_466 = (A_firstFree_466 - 1); this_483 = A_nextFree_400[A_firstFree_466]; A_typeId_190[this_483] = 2; }; return this_483; } function error124(string msg166) { $debugPrint940((msg_166 + (" " + #getStackTrace()))); }