Commits

Daniel Green committed 857c564

Allow inline assembly to set return values. Matches DMD functionality.

  • Participants
  • Parent commits ac87eb9

Comments (0)

Files changed (1)

File d/asmstmt.cc

 #endif
     sc->func->inlineStatus = ILSno; // %% not sure
     // %% need to set DECL_UNINLINABLE too?
+    
+    // DMD assumes that inline assembly sets return argument.
+    // This avoids "missing return expression" assertion.
+    FuncDeclaration *fd = sc->parent->isFuncDeclaration();
+    gcc_assert(fd);    
+    fd->inlineAsm = 1;
+    
     sc->func->hasReturnExp |= 8; // %% DMD does this, apparently...
 
     // empty statement -- still do the above things because they might be expected?