array A_nextFree107 integer A_firstFree442 integer A_maxIndex184 array A_typeId956 integer A_firstFree442 = 0 integer A_maxIndex184 = 0 function initGlobals870() { } function main148() { initGlobals870(); init_test117(); } function config919() { } function init_test117() { local integer b144 b_144 = new_B141(); if (A_typeId_956[b_144] == 0) { if (b_144 == 0) { error163("Nullpointer exception when calling A.foo"); } else { error163("Called A.foo on invalid object."); }; } else { }; testSuccess139(); } IS_NATIVE function testSuccess139() { } function new_B141() returns integer { local integer this151 if (A_firstFree_442 == 0) { if (A_maxIndex_184 < 32768) { A_maxIndex_184 = (A_maxIndex_184 + 1); this_151 = A_maxIndex_184; A_typeId_956[this_151] = 2; } else { error163("Out of memory: Could not create B."); this_151 = 0; }; } else { A_firstFree_442 = (A_firstFree_442 - 1); this_151 = A_nextFree_107[A_firstFree_442]; A_typeId_956[this_151] = 2; }; return this_151; } function error163(string msg752) { $debugPrint184((msg_752 + (" " + #getStackTrace()))); }