RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
195 stars 42 forks source link

asar_getlabelval throws C++ exception for missing label #277

Closed spooonsss closed 1 year ago

spooonsss commented 1 year ago

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 634d6baf

    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#