mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
fpcmp: Fix bug where fpcmp wouldn't early exit when files obviously differ and
no tolerance is set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d1c82fe726
commit
71907fbebf
@ -212,17 +212,17 @@ int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
|
|||||||
const char *F1P = File1Start;
|
const char *F1P = File1Start;
|
||||||
const char *F2P = File2Start;
|
const char *F2P = File2Start;
|
||||||
|
|
||||||
if (A_size == B_size) {
|
|
||||||
// Are the buffers identical? Common case: Handle this efficiently.
|
// Are the buffers identical? Common case: Handle this efficiently.
|
||||||
if (std::memcmp(File1Start, File2Start, A_size) == 0)
|
if (A_size == B_size &&
|
||||||
|
std::memcmp(File1Start, File2Start, A_size) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// Otherwise, we are done a tolerances are set.
|
||||||
if (AbsTol == 0 && RelTol == 0) {
|
if (AbsTol == 0 && RelTol == 0) {
|
||||||
if (Error)
|
if (Error)
|
||||||
*Error = "Files differ without tolerance allowance";
|
*Error = "Files differ without tolerance allowance";
|
||||||
return 1; // Files different!
|
return 1; // Files different!
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool CompareFailed = false;
|
bool CompareFailed = false;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user