Skip to content

Commit 50269e5

Browse files
committed
32-bit arm alignment crash
1 parent 074dd49 commit 50269e5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

jsrc/va1ss.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ A jtssingleton1(J jt, A w,I caseno){A z;void *zv;
2828
// Start loading everything we will need as values before the pipeline break. Tempting to convert int-to-float as well, but perhaps it will predict right?
2929
I wiv=IAV(w)[0],ziv;
3030
#if defined(__aarch32__)||defined(__arm__)||defined(_M_ARM)
31-
volatile D wdv=DAV(w)[0]; // avoid bus error
31+
D wdv;
32+
memcpy(&wdv,DAV(w),4);
33+
memcpy(4+(char*)&wdv,4+(char*)DAV(w),4); // avoid bus error
3234
#else
3335
D wdv=DAV(w)[0];
3436
#endif

jsrc/va2ss.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ nozv:; // here when we have zv or don't need it
6262
// Start loading everything we will need as values before the pipeline break. Tempting to convert int-to-float as well, but perhaps it will predict right?
6363
aiv=IAV(a)[0]; I wiv=IAV(w)[0],ziv;
6464
#if defined(__aarch32__)||defined(__arm__)||defined(_M_ARM)
65-
volatile D adv=DAV(a)[0],wdv=DAV(w)[0]; // avoid bus error
65+
D adv,wdv;
66+
memcpy(&adv,DAV(a),4);
67+
memcpy(4+(char*)&adv,4+(char*)DAV(a),4); // avoid bus error
68+
memcpy(&wdv,DAV(w),4);
69+
memcpy(4+(char*)&wdv,4+(char*)DAV(w),4); // avoid bus error
6670
#else
6771
D adv=DAV(a)[0],wdv=DAV(w)[0];
6872
#endif

0 commit comments

Comments
 (0)