fixed bug #443257
[fw/sdcc] / src / pic / gen.c
index e42fc0b0d6875ed52da2242e8d16783d254ed33b..023ee3e7995ff7133d3b8c96db6b046a0eebb331 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef HAVE_ENDIAN_H
 #include <endian.h>
 #else
-#if !defined(__BORLANDC__) && !defined(_MSC_VER)
+#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(__MINGW32__)
 #warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
 #warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
 #endif
@@ -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 */