changed inline asm buffers from static to dynamic size
[fw/sdcc] / src / mcs51 / gen.c
index dcdc36ed1ac1e6f7558448cae08a9d7f301e481d..8fe501bab5eaf9bc2f9797dc71dff3e71a2ba4a0 100644 (file)
@@ -120,7 +120,7 @@ static void
 emitcode (char *inst, char *fmt,...)
 {
   va_list ap;
-  char lb[MAX_INLINEASM];
+  char lb[INITIAL_INLINEASM];
   char *lbp = lb;
 
   va_start (ap, fmt);
@@ -3113,7 +3113,7 @@ genMultOneByte (operand * left,
   if (size<1 || size>2) {
     // this should never happen
       fprintf (stderr, "size!=1||2 (%d) in %s at line:%d \n", 
-              AOP_SIZE(result), __FUNCTION__, lineno);
+              AOP_SIZE(result), __FILE__, lineno);
       exit (1);
   }
 
@@ -4994,11 +4994,11 @@ release:
 static void
 genInline (iCode * ic)
 {
-  char buffer[MAX_INLINEASM];
-  char *bp = buffer;
-  char *bp1 = buffer;
+  char *buffer, *bp, *bp1;
 
   _G.inLine += (!options.asmpeep);
+
+  buffer = bp = bp1 = Safe_calloc(1, strlen(IC_INLINE(ic)+1));
   strcpy (buffer, IC_INLINE (ic));
 
   /* emit each line as a code */