mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-27 15:29:51 +00:00
We don't need to byteswap, the interpreter assumes the program is running
native anyways. This fixes a crash using %d and similar in a scanf statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86440 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
474f0df3ac
commit
327127909e
@ -468,8 +468,7 @@ static void ByteswapSCANFResults(LLVMContext &C,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e': case 'g': case 'E':
|
case 'e': case 'g': case 'E': case 'f':
|
||||||
case 'f':
|
|
||||||
if (Long || LongLong) {
|
if (Long || LongLong) {
|
||||||
Size = 8; Ty = Type::getDoubleTy(C);
|
Size = 8; Ty = Type::getDoubleTy(C);
|
||||||
} else {
|
} else {
|
||||||
@ -508,9 +507,6 @@ GenericValue lle_X_sscanf(const FunctionType *FT,
|
|||||||
GenericValue GV;
|
GenericValue GV;
|
||||||
GV.IntVal = APInt(32, sscanf(Args[0], Args[1], Args[2], Args[3], Args[4],
|
GV.IntVal = APInt(32, sscanf(Args[0], Args[1], Args[2], Args[3], Args[4],
|
||||||
Args[5], Args[6], Args[7], Args[8], Args[9]));
|
Args[5], Args[6], Args[7], Args[8], Args[9]));
|
||||||
ByteswapSCANFResults(FT->getContext(),
|
|
||||||
Args[1], Args[2], Args[3], Args[4],
|
|
||||||
Args[5], Args[6], Args[7], Args[8], Args[9], 0);
|
|
||||||
return GV;
|
return GV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,9 +522,6 @@ GenericValue lle_X_scanf(const FunctionType *FT,
|
|||||||
GenericValue GV;
|
GenericValue GV;
|
||||||
GV.IntVal = APInt(32, scanf( Args[0], Args[1], Args[2], Args[3], Args[4],
|
GV.IntVal = APInt(32, scanf( Args[0], Args[1], Args[2], Args[3], Args[4],
|
||||||
Args[5], Args[6], Args[7], Args[8], Args[9]));
|
Args[5], Args[6], Args[7], Args[8], Args[9]));
|
||||||
ByteswapSCANFResults(FT->getContext(),
|
|
||||||
Args[0], Args[1], Args[2], Args[3], Args[4],
|
|
||||||
Args[5], Args[6], Args[7], Args[8], Args[9]);
|
|
||||||
return GV;
|
return GV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user