diff options
author | Karl Williamson <khw@cpan.org> | 2018-11-11 21:48:53 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-11-16 09:21:35 -0700 |
commit | 46167d76640b8ae760665fc0fd2f94ac4760438c (patch) | |
tree | 5293f3d96b38ccc90f4ebd7bcd4582243273bb77 /regen | |
parent | 282634ed6aed040ba8694186b410779d98331944 (diff) | |
download | perl-46167d76640b8ae760665fc0fd2f94ac4760438c.tar.gz |
regcomp.sym: longj field is a boolean
The comments could lead one to thinking one could specify any of the
argument fields that nodes can have. But in fact, the value is a
boolean, 0 meaning to use the normal offset field of all regnodes; and 1
meaning to use the ARG field that some regnodes have. If a regnode had
more than just the one argument field, the one that corresponds to that
would be used.
This commit enforces that, and changes regcomp.sym to not use '2',
which is misleading.
It clarifies the comments about this and what '.' means in the flags
field
Diffstat (limited to 'regen')
-rw-r--r-- | regen/regcomp.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/regen/regcomp.pl b/regen/regcomp.pl index ffb7d7a13f..cb9861318d 100644 --- a/regen/regcomp.pl +++ b/regen/regcomp.pl @@ -54,7 +54,7 @@ use strict; # code Op what code is associated with this node (???) # args Op what type of args the node has (which regnode struct) # flags Op (???) -# longj Op Whether this node is a longjump +# longj Op Boolean as to if this node is a longjump # comment Both Comment about node, if any # pod_comment Both Special comments for pod output (preceding lines in def) @@ -89,6 +89,11 @@ sub register_node { $node->{id}= 0 + @all; push @all, $node; $all{ $node->{name} }= $node; + + if ($node->{longj} && $node->{longj} != 1) { + die "longj field must be in [01] if present in ", Dumper($node); + } + } # Parse and add an opcode definition to the global state. |