diff options
author | David Benjamin <davidben@google.com> | 2019-01-30 00:41:39 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2019-02-17 23:39:51 +0100 |
commit | e09633107b7e987b2179850715ba60d8fb069278 (patch) | |
tree | 9c98a389651499813f26b7ab5021addb703884ad /crypto/perlasm | |
parent | Fix some CFI issues in x86_64 assembly (diff) | |
download | openssl-e09633107b7e987b2179850715ba60d8fb069278.tar.xz openssl-e09633107b7e987b2179850715ba60d8fb069278.zip |
Check for unpaired .cfi_remember_state
Reviewed-by: Richard Levitte <levitte@openssl.org>
GH: #8109
Diffstat (limited to '')
-rwxr-xr-x | crypto/perlasm/x86_64-xlate.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 080fc8d881..4a7ec7a6e9 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -649,7 +649,13 @@ my %globals; # why it starts with -8. Recall that CFA is top of caller's # stack... /startproc/ && do { ($cfa_reg, $cfa_rsp) = ("%rsp", -8); last; }; - /endproc/ && do { ($cfa_reg, $cfa_rsp) = ("%rsp", 0); last; }; + /endproc/ && do { ($cfa_reg, $cfa_rsp) = ("%rsp", 0); + # .cfi_remember_state directives that are not + # matched with .cfi_restore_state are + # unnecessary. + die "unpaired .cfi_remember_state" if (@cfa_stack); + last; + }; /def_cfa_register/ && do { $cfa_reg = $$line; last; }; /def_cfa_offset/ |