RPGHacker/asar

asar_getlabelval throws C++ exception for missing label

spooonsss opened this issue · 0 comments

asardll.h says:

//Get the ROM location of one label. -1 means "not found".
asarfunc int (*asar_getlabelval)(const char * name);

but labelval passes shouldthrow=true to labelvalcore, so it throws an exception instead.

C# stacktrace against 634d6ba

 	KernelBase.dll!RaiseException()	Unknown
 	asar.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 75	C++
 	asar.dll!asar_error_template<errblock>(asar_error_id errid, int whichpass, const char * message) Line 306	C++
 	asar.dll!asar_throw_error(int whichpass, asar_error_type type, asar_error_id errid, ...) Line 351	C++
 	asar.dll!labelvalcore(const char * * rawname, snes_label * rval, bool define, bool shouldthrow) Line 485	C++
 	asar.dll!labelval(const char * * rawname, bool define) Line 500	C++
 	asar.dll!asar_getlabelval(const char * name) Line 462	C++
 	[Managed to Native Transition]	
 	AsarTest.exe!AsarCLR.Asar.getlabelval(string labelName) Line 390	C#