diff gen/asm-x86-64.h @ 1563:b0a691de8cc7

Fixed bug #349 , now emits error.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sun, 02 Aug 2009 17:56:30 +0200
parents a0114765fe34
children 3a08f5e2553b
line wrap: on
line diff
--- a/gen/asm-x86-64.h	Sat Aug 01 18:23:52 2009 +0200
+++ b/gen/asm-x86-64.h	Sun Aug 02 17:56:30 2009 +0200
@@ -1676,7 +1676,13 @@
         }
         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;