mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
fix 64-bit constant comparisons on 32-bit platforms
This commit is contained in:
parent
5d5a18c482
commit
857dcd13e7
@ -4741,9 +4741,17 @@ class BranchEvent: public Event {
|
|||||||
|
|
||||||
if (not unreachable(this)) {
|
if (not unreachable(this)) {
|
||||||
if (firstConstant and secondConstant) {
|
if (firstConstant and secondConstant) {
|
||||||
if (shouldJump(c, type, size, firstConstant->value->value(),
|
int64_t firstValue = firstConstant->value->value();
|
||||||
secondConstant->value->value()))
|
int64_t secondValue = secondConstant->value->value();
|
||||||
{
|
|
||||||
|
if (size > BytesPerWord) {
|
||||||
|
firstValue |= findConstantSite
|
||||||
|
(c, first->nextWord)->value->value() << 32;
|
||||||
|
secondValue |= findConstantSite
|
||||||
|
(c, second->nextWord)->value->value() << 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldJump(c, type, size, firstValue, secondValue)) {
|
||||||
apply(c, Jump, BytesPerWord, address->source, address->source);
|
apply(c, Jump, BytesPerWord, address->source, address->source);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,6 +60,11 @@ public class Longs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
{ long a = 0x1FFFFFFFFL;
|
||||||
|
long b = -1;
|
||||||
|
expect(a != b);
|
||||||
|
}
|
||||||
|
|
||||||
expect(Math.abs(-123L) == 123L);
|
expect(Math.abs(-123L) == 123L);
|
||||||
|
|
||||||
expect(readLongFrom(new java.io.InputStream() {
|
expect(readLongFrom(new java.io.InputStream() {
|
||||||
|
Loading…
Reference in New Issue
Block a user