-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.arch-armIssues solely affecting the 32-bit arm architecture.Issues solely affecting the 32-bit arm architecture.
Milestone
Description
@FiloSottile suggested that a recent mailing list post be moved to an issue, so here goes:
Jan Mercl reports that this code will miscompile on ARM:
package main
import "fmt"
var x = [4]int32{((-0x7fffffff - 1) / 2), 0x7fffffff, 2, 4} /* 20041210-1.c:5:5 */
func main() { /* 20041210-1.c:8:1: */
if x[0] < x[1] {
if x[2]&x[3] < 0 {
panic(fmt.Errorf("%v & %v = %v, < 0 ? %v", x[2], x[3], x[2]&x[3], x[2]&x[3] < 0))
}
}
}Running the same code on 386 vs arm shows success on 386 and panics on arm. I've confirmed this is the case with 1.15.5, and Meng Zhuo confirmed it to be happening on 1.13, so it is at least a somewhat oldish bug.
The current issue title is vague because I haven't looked into what's actually happening yet. And I haven't yet assessed the security implications, either, but one can start imagining worrisome corner cases.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.arch-armIssues solely affecting the 32-bit arm architecture.Issues solely affecting the 32-bit arm architecture.