[LLVMdev] Minor AsmPrinter bug fix

Burke, Max mburke at ea.com
Thu Jan 22 15:30:39 PST 2009


The Microsoft CRT's implementation of isprint() has an internal assert
that the unsigned value passed in is in [0,256) but unprintable chars
passed in are sign extended to values that falsely trigger this assert.

--- c:\usr\src\llvm-svn\lib\CodeGen\AsmPrinter\AsmPrinter.cpp  Tue Jan
20 10:30:42 2009
+++ c:\usr\src\llvm-integrate\lib\CodeGen\AsmPrinter\AsmPrinter.cpp
Thu Jan 22 15:19:47 2009

@@ -681,7 +681,7 @@
     O << "\\\"";
   } else if (C == '\\') {
     O << "\\\\";
-  } else if (isprint(C)) {
+  } else if (isprint((unsigned char)C)) {
     O << C;
   } else {
     switch(C) {





More information about the llvm-dev mailing list