mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-03 18:32:50 +00:00
Add %p format to printf, which MUST be used when printing pointer values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1166 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8679005193
commit
6a6791b326
@ -291,6 +291,8 @@ GenericValue lle_X_printf(MethodType *M, const vector<GenericValue> &Args) {
|
||||
sprintf(Buffer, Fmt, Args[ArgNo++].IntVal); break;
|
||||
case 'e': case 'E': case 'g': case 'G': case 'f':
|
||||
sprintf(Buffer, Fmt, Args[ArgNo++].DoubleVal); break;
|
||||
case 'p':
|
||||
sprintf(Buffer, Fmt, (void*)Args[ArgNo++].PointerVal); break;
|
||||
case 's': cout << (char*)Args[ArgNo++].PointerVal; break; // %s
|
||||
default: cout << "<unknown printf code '" << *FmtStr << "'!>";
|
||||
ArgNo++; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user