From 8491986e699e7d14c9160f26444f002b042fcfd8 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 20 May 2008 10:39:15 -0700 Subject: [PATCH] insns.pl: fix splitting of bracketted operations --- insns.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/insns.pl b/insns.pl index a3eb0ccf..fdeeaa51 100644 --- a/insns.pl +++ b/insns.pl @@ -363,13 +363,14 @@ sub decodify($) { # only octal escapes (for directives) and hexadecimal escapes # (for verbatim bytes) my($codestr) = @_; - my $c = $codestr; - my @codes = (); if ($codestr =~ /^\s*\[([^\]]*)\]\s*$/) { return byte_code_compile($1); } + my $c = $codestr; + my @codes = (); + while ($c ne '') { if ($c =~ /^\\x([0-9a-f]+)(.*)$/i) { push(@codes, hex $1); @@ -505,7 +506,7 @@ sub byte_code_compile($) { $opc = "\L$2"; } else { $opr = ''; - $opc = $str; + $opc = "\L$str"; } for ($i = 0; $i < length($opr); $i++) { @@ -513,7 +514,7 @@ sub byte_code_compile($) { } $prefix_ok = 1; - foreach $op (split($opc)) { + foreach $op (split(/\s+/, $opc)) { if ($op eq 'o16') { push(@codes, 0320); } elsif ($op eq 'o32') {