Fixed bug #349 , now emits error.

This commit is contained in:
Tomas Lindquist Olsen
2009-08-02 17:56:30 +02:00
parent c69e5a5c83
commit df82d09206
2 changed files with 14 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;