Make x86_64-xlate.pl 'use strict' clean.
authorDavid Benjamin <davidben@google.com>
Sun, 20 Mar 2016 18:47:36 +0000 (14:47 -0400)
committerAndy Polyakov <appro@openssl.org>
Tue, 14 Jun 2016 20:50:04 +0000 (22:50 +0200)
commitc25278db8e4c21772a0cd81f7873e767cbc6d219
tree02b48ce954764147fd7929e5bf51fdb23a235c64
parentb867c7077a0ebf2ca17f9d020c112f790074571b
Make x86_64-xlate.pl 'use strict' clean.

use strict would have caught a number of historical bugs in the perlasm
code, some in the repository and some found during review. It even found
a fresh masm-only bug (see below).

This required some tweaks. The "single instance is enough" globals got
switched to proper blessed objects rather than relying on symbolic refs.
A few types need $opcode passed in as a result.

The $$line thing is a little bit of a nuisance. There may be a clearer
pattern to use instead.

This even a bug in the masm code.
9b634c9b37afc482a8dc8868e367bdd1b650e507 added logic to make labels
global or function-global based on whether something starts with a $,
seemingly intended to capture the $decor setting of '$L$'. However, it
references $ret which is not defined in label::out. label::out is always
called after label::re, so $ret was always the label itself, so the line
always ran.

I've removed the regular expression so as not to change the behavior of
the script. A number of the assembly files now routinely jump across
functions, so this seems to be the desired behavior now.

GH#1165

Signed-off-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/perlasm/x86_64-xlate.pl