]> git.gag.com Git - fw/sdcc/commitdiff
changed inline asm buffers from static to dynamic size
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 May 2001 16:11:38 +0000 (16:11 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 May 2001 16:11:38 +0000 (16:11 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@839 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/avr/gen.c
src/ds390/gen.c
src/mcs51/gen.c
src/pic/gen.c
src/z80/gen.c

index 0cb4b0f120630bc513d9f7b27f3459787ea4162d..b16ce95425ff357429a4c7f8516cb2c3c3b2b515 100644 (file)
@@ -115,7 +115,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);
@@ -2886,11 +2886,11 @@ genXor (iCode * ic, iCode * ifx)
 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 */
index ab8b9654eaa925fdfa50aa977915b42ad81f9f83..0f1df71133dfe41db19a150bd695e85792107ccb 100644 (file)
@@ -126,7 +126,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);
@@ -5777,14 +5777,14 @@ release:
 static void
 genInline (iCode * ic)
 {
-  char buffer[MAX_INLINEASM];
-  char *bp = buffer;
-  char *bp1 = buffer;
+  char *buffer, *bp, *bp1;
 
   D (emitcode (";", "genInline ");
     );
 
   _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 */
index 91dfbcc320180506e98d3d34315f330b690167e6..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);
@@ -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 */
index e42fc0b0d6875ed52da2242e8d16783d254ed33b..20f57a1bb3e699528e43d91d500049883cfdf75b 100644 (file)
@@ -147,7 +147,7 @@ void emitpcode(PIC_OPCODE poc, pCodeOp *pcop)
 void pic14_emitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[INITIAL_INLINEASM];  
     char *lbp = lb;
 
     va_start(ap,fmt);   
@@ -179,7 +179,7 @@ void pic14_emitcode (char *inst,char *fmt, ...)
 void DEBUGpic14_emitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[INITIAL_INLINEASM];  
     char *lbp = lb;
 
     if(!debug_verbose)
@@ -4944,13 +4944,13 @@ release :
 /*-----------------------------------------------------------------*/
 static void genInline (iCode *ic)
 {
-    char buffer[MAX_INLINEASM];
-    char *bp = buffer;
-    char *bp1= buffer;
+    char *buffer, *bp, *bp1;
     
     DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     _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 */
index 5c3e5c9baabfb944e4d51acbd9ab7d43c2efddb6..3e6d40a411c066dd63d9c5fe1c5af75a963bedc4 100644 (file)
@@ -235,7 +235,7 @@ void
 emitcode (const char *inst, const char *fmt,...)
 {
   va_list ap;
-  char lb[MAX_INLINEASM];
+  char lb[INITIAL_INLINEASM];
   char *lbp = lb;
 
   va_start (ap, fmt);
@@ -4082,11 +4082,11 @@ release:
 static void
 genInline (iCode * ic)
 {
-  char buffer[MAX_INLINEASM];
-  char *bp = buffer;
-  char *bp1 = buffer;
+  char *buffer, *bp, *bp1;
 
   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 */