diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check index d532f37271..3cbdec582f 100755 --- a/tools/ocaml/libs/xc/abi-check +++ b/tools/ocaml/libs/xc/abi-check @@ -70,14 +70,7 @@ my $cval; $ei = undef; my $bitnum = 0; while () { - if (!$ei) { - if (m{^type \s+ (\w+) \s* \= \s* $}x && $enums{$1}) { - print "// found ocaml type $1 at $o:$.\n" or die $!; - $ei = $enums{$1}; - $cval = ''; - $bitnum = 0; - } - } else { + if ($ei) { if (m{^\s+ \| \s* $ei->{OPrefix} (\w+) \s*$}x) { $cval = $1; if ($ei->{Mangle} eq 'lc') { @@ -104,6 +97,14 @@ while () { die "$_ ?"; } } + if (!$ei) { + if (m{^type \s+ (\w+) \s* \= \s* $}x && $enums{$1}) { + print "// found ocaml type $1 at $o:$.\n" or die $!; + $ei = $enums{$1}; + $cval = ''; + $bitnum = 0; + } + } } foreach $ei (values %enums) {