JIT: fix miscompilaton of char=?
, char<?
When the first subexpression is complex and the second is a literal character, the generated JIT code swaps the argument order, but compilation didn't swap the test for whether one or the other is a literal character to skip a run-time test.
This commit is contained in:
parent
da41bdf43a
commit
598a5baf6a
|
@ -1055,6 +1055,13 @@
|
||||||
|
|
||||||
(test 9 dynamic-require ''assign-to-bytes-array-with-non-constant-offset 'out)
|
(test 9 dynamic-require ''assign-to-bytes-array-with-non-constant-offset 'out)
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Make sure `char=?` and similar don't get confused when trying to
|
||||||
|
;; reverse the argument order internally
|
||||||
|
(let ([f (lambda () (char=? (peek-char (open-input-string "")) #\x))])
|
||||||
|
(set! f f)
|
||||||
|
(err/rt-test (f)))
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -2697,6 +2697,9 @@ static int generate_binary_char(mz_jit_state *jitter, Scheme_App3_Rec *app, int
|
||||||
|
|
||||||
if (direction < 0) {
|
if (direction < 0) {
|
||||||
/* reverse sense of comparison */
|
/* reverse sense of comparison */
|
||||||
|
GC_CAN_IGNORE Scheme_Object *tmp = r2;
|
||||||
|
r2 = r1;
|
||||||
|
r1 = tmp;
|
||||||
switch (cmp) {
|
switch (cmp) {
|
||||||
case CMP_LEQ:
|
case CMP_LEQ:
|
||||||
cmp = CMP_GEQ;
|
cmp = CMP_GEQ;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user