Files
swift-mirror/lib/Serialization/ModuleFile.cpp
Bob Wilson 3d67d824ed Avoid undefined behavior with std::minmax and rvalues.
The behavior of std::minmax with rvalue arguments is undefined after the
end of the expression that contains the call to minmax. This code to
special-case the comparisons for ARM vs. Thumb and macOS vs. Darwin was a
little overly clever anyway. Rewrite it to use straightforward comparisons.
This fixes a test failure in Serialization/target-incompatible.swift when
building with a recent version of clang, because these checks were completely
optimized away due to the undefined behavior. rdar://problem/28700005
2016-10-11 11:04:52 -07:00

53 KiB