OSDN Git Service

* lost patch from RH tree:
authorbje <bje>
Wed, 18 Dec 2002 01:43:10 +0000 (01:43 +0000)
committerbje <bje>
Wed, 18 Dec 2002 01:43:10 +0000 (01:43 +0000)
2001-09-17  graydon hoare  <graydon@redhat.com>

* insn.scm (syntax-break-out): Correct logic in handling escaped
syntax characters.

cgen/ChangeLog
cgen/insn.scm

index 30f7ae7..ef07746 100644 (file)
        * cpu/m32r.opc: The same.
        * cpu/openrisc.opc: The same.
 
+2001-09-17  graydon hoare  <graydon@redhat.com>
+
+       * insn.scm (syntax-break-out): Correct logic in handling escaped
+       syntax characters.
+
 2001-07-12  Jeff Johnston  <jjohnstn@redhat.com>
 
        * opc-itab.scm (@arch@_cgen_init_opcode_table): Unconditionally
index 1806ea3..f438878 100644 (file)
 
 ; Filter out instructions whose ifield patterns are strict supersets of
 ; another, keeping the less general cousin.  Used to resolve ambiguity
-; when there are no more bits to consider while decoding.
+; when there are no more bits to consider.
 
 (define (filter-non-specialized-ambiguous-insns insn-list)
   (logit 3 "Filtering " (length insn-list) " instructions for non specializations.\n")
            (cond 
             ; Handle escaped syntax metacharacters 
             ((char=? #\\ (string-ref syntax 0))
-             (set! result (cons (substring syntax 0 1) result))
-             (set! result (cons (substring syntax 1 1) result))
-             (set! syntax (string-drop 2 syntax)))
-            ; Handle operand reference
+             (begin
+               (if (= (string-length syntax) 1)
+                   (parse-error context "syntax-break-out: missing char after '\\' in " syntax))
+               (set! result (cons (substring syntax 1 2) result))
+               (set! syntax (string-drop 2 syntax))))
+               ; Handle operand reference
             ((char=? #\$ (string-ref syntax 0))
              ; Extract the symbol from the string, get the operand.
              (if (char=? #\{ (string-ref syntax 1))