diff --git a/gen/asm-x86-32.h b/gen/asm-x86-32.h index 746669a7..26af972f 100644 --- a/gen/asm-x86-32.h +++ b/gen/asm-x86-32.h @@ -1555,7 +1555,13 @@ namespace AsmParserx8632 } void addOperand2 ( const char * fmtpre, const char * fmtpost, AsmArgType type, Expression * e, AsmCode * asmcode, AsmArgMode mode = Mode_Input ) { - assert ( !sc->func->naked ); + if ( sc->func->naked ) + { + // taken from above + stmt->error ( "only global variables can be referenced by identifier in naked asm" ); + return; + } + insnTemplate << fmtpre << "<<" << (mode==Mode_Input ? "in" : "out") << ">>" << fmtpost; diff --git a/gen/asm-x86-64.h b/gen/asm-x86-64.h index 0ae4df4b..7bc98911 100644 --- a/gen/asm-x86-64.h +++ b/gen/asm-x86-64.h @@ -1676,7 +1676,13 @@ namespace AsmParserx8664 } void addOperand2 ( const char * fmtpre, const char * fmtpost, AsmArgType type, Expression * e, AsmCode * asmcode, AsmArgMode mode = Mode_Input ) { - assert ( !sc->func->naked ); + if ( sc->func->naked ) + { + // taken from above + stmt->error ( "only global variables can be referenced by identifier in naked asm" ); + return; + } + insnTemplate << fmtpre << "<<" << (mode==Mode_Input ? "in" : "out") << ">>" << fmtpost;