diff gen/toir.cpp @ 1036:01544da4cdd8

Added ~{memory} clobber when a jump_target is generated in inline asm (branch out of inline asm)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 03 Mar 2009 19:18:47 +0100
parents e594385d7e53
children b30fe7e1dbb9
line wrap: on
line diff
--- a/gen/toir.cpp	Tue Mar 03 19:03:27 2009 +0100
+++ b/gen/toir.cpp	Tue Mar 03 19:18:47 2009 +0100
@@ -2593,7 +2593,11 @@
 STUB(SymbolExp);
 #endif
 
-#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) {error("non-const expression '%s' or const Exp type "#x" not implemented", toChars()); fatal(); return NULL; }
+#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) { \
+    error("expression '%s' is not a constant", toChars()); \
+    fatal(); \
+    return NULL; \
+}
 CONSTSTUB(Expression);
 CONSTSTUB(GEPExp);
 CONSTSTUB(SliceExp);
@@ -2761,9 +2765,10 @@
 
 void obj_includelib(const char* lib)
 {
-    char *arg = (char *)mem.malloc(64);
+    size_t n = strlen(lib)+3;
+    char *arg = (char *)mem.malloc(n);
     strcpy(arg, "-l");
-    strncat(arg, lib, 64);
+    strncat(arg, lib, n);
     global.params.linkswitches->push(arg);
 }