Example #1
0
void freeLocal(SymTableNodePtr idPtr)
{
	//---------------------------------------
	// Frees data allocated on local stack...
	TypePtr typePtr = (TypePtr)(idPtr->typePtr);
	StackItemPtr itemPtr = nullptr;
	if(((typePtr->form == FRM_ARRAY) /* || (typePtr->form == FRM_RECORD)*/) &&
			(idPtr->defn.key != DFN_REFPARAM))
	{
		switch(idPtr->defn.info.data.varType)
		{
			case VAR_TYPE_NORMAL:
				itemPtr = stackFrameBasePtr + idPtr->defn.info.data.offset;
				break;
//			case VAR_TYPE_ETERNAL:
//				itemPtr = stack + idPtr->defn.info.data.offset;
//				break;
//			case VAR_TYPE_STATIC:
//				itemPtr = StaticDataPtr + idPtr->defn.info.data.offset;
//				break;
		}
		if(!itemPtr)
			runtimeError(0);
		else
			ABLStackFreeCallback(itemPtr->address);
	}
}
Example #2
0
void ABLModule::destroy(void)
{
    int32_t i;
    if((id > -1) && ModuleInstanceRegistry)
    {
        //-----------------------------------------------
        // It's on the active registry, so pull it off...
        for(i = 0; i < NumModuleInstances; i++)
            if(ModuleInstanceRegistry[i] == this)
            {
                ModuleInstanceRegistry[i] = ModuleInstanceRegistry[NumModuleInstances - 1];
                ModuleInstanceRegistry[NumModuleInstances - 1] = nullptr;
                NumModuleInstances--;
                NumModules--;
                break;
            }
    }
    if(watchManager)
    {
        delete watchManager;
        watchManager = nullptr;
    }
    if(breakPointManager)
    {
        delete breakPointManager;
        breakPointManager = nullptr;
    }
    if(staticData)
    {
        ABLStackFreeCallback(staticData);
        staticData = nullptr;
    }
}
Example #3
0
void BreakPointManager::destroy(void)
{
	if(breakPoints)
	{
		ABLStackFreeCallback(breakPoints);
		breakPoints = nullptr;
	}
	maxBreakPoints = 0;
	numBreakPoints = 0;
}
Example #4
0
void WatchManager::destroy(void)
{
	if(watches)
	{
		ABLStackFreeCallback(watches);
		watches = nullptr;
	}
	maxWatches = 0;
	numWatches = 0;
}
Example #5
0
void destroyModuleRegistry(void)
{
    //-----------------------------------------------------------
    // First, go through the registry, free'n each module and its
    // associated data...
    for(size_t i = 0; i < NumModulesRegistered; i++)
    {
        ABLStackFreeCallback(ModuleRegistry[i].fileName);
        ModuleRegistry[i].fileName = nullptr;
        ModuleRegistry[i].moduleIdPtr = nullptr;
        for(size_t j = 0; j < ModuleRegistry[i].numSourceFiles; j++)
        {
            ABLStackFreeCallback(ModuleRegistry[i].sourceFiles[j]);
            ModuleRegistry[i].sourceFiles[j] = nullptr;
        }
    }
    ABLStackFreeCallback(ModuleRegistry);
    ModuleRegistry = nullptr;
    ABLStackFreeCallback(ModuleInstanceRegistry);
    ModuleInstanceRegistry = nullptr;
}
Example #6
0
void destroyLibraryRegistry(void)
{
    //-----------------------------------------------------------------
    // Kinda need to do the same thing here as in the normal Registry.
    // Or leak o RAMA!!!!!!!
    // The actual data held by the pointer is removed in destroyModuleRegistry.
    // However, the classes holding the actual ABLModulePtr are then responsible
    // for deleting the ABLModulePtr.  Libraries have no owner class which, I'm guessing,
    // this class was supposed to do.  This class now does that!!!!
    // -fs		1/25/98
    for(size_t i = 0; i < numLibrariesLoaded; i++)
    {
        delete LibraryInstanceRegistry[i];
        LibraryInstanceRegistry[i] = nullptr;
    }
    ABLStackFreeCallback(LibraryInstanceRegistry);
    LibraryInstanceRegistry = nullptr;
}
Example #7
0
void Debugger::operator delete(PVOID us)
{
	ABLStackFreeCallback(us);
}
Example #8
0
void BreakPointManager::operator delete(PVOID us)
{
	ABLStackFreeCallback(us);
}
Example #9
0
void WatchManager::operator delete(PVOID us)
{
	ABLStackFreeCallback(us);
}
Example #10
0
void switchStatement (void) {

	//-------------------------
	// Init the branch table...
	getToken();
	char* branchTableLocation = crunchAddressMarker(NULL);

CaseItemPtr	caseItemHead = NULL;
CaseItemPtr	caseItemTail = NULL;
long caseLabelCount = 0;
	
//CaseItemHead = CaseItemTail = NULL;
//CaseLabelCount = 0;

	TypePtr expressionType = expression();

	//-----------------------------------------------------------------------------
	// NOTE: If we have subranges in ABL, we'll have to check in the following line
	// for a subrange, as well...
	if (((expressionType->form != FRM_SCALAR) && (expressionType->form != FRM_ENUM)) || (expressionType == RealTypePtr))
		syntaxError(ABL_ERR_SYNTAX_INCOMPATIBLE_TYPES);

	synchronize(FollowSwitchExpressionList, NULL, NULL);

	//----------------------------
	// Process each CASE branch...
	bool moreBranches = (curToken == TKN_CASE);
	char* caseEndChain = NULL;
	while (moreBranches) {
		getToken();
		if (tokenIn(CaseLabelStartList))
			caseBranch(caseItemHead, caseItemTail, caseLabelCount, expressionType);

		//---------------------------------------------------
		// Link another address marker at the end of the CASE
		// branch to point to the end of the CASE block...
		caseEndChain = crunchAddressMarker(caseEndChain);

		moreBranches = (curToken == TKN_CASE);
	}

	//if (curToken == TKN_DEFAULT) {
	//}

	//-------------------------
	// Emit the branch table...
	fixupAddressMarker(branchTableLocation);
	crunchInteger(caseLabelCount);
	CaseItemPtr caseItem = caseItemHead;
	while (caseItem) {
		crunchInteger(caseItem->labelValue);
		crunchOffset(caseItem->branchLocation);
		CaseItemPtr nextCaseItem = caseItem->next;
		ABLStackFreeCallback(caseItem);
		caseItem = nextCaseItem;
	}

	ifTokenGetElseError(TKN_END_SWITCH, ABL_ERR_SYNTAX_MISSING_END_SWITCH);

	//--------------------------------------------
	// Patch up the case branch address markers...
	while (caseEndChain)
		caseEndChain = fixupAddressMarker(caseEndChain);

}