diff options
author | Alan Modra <amodra@gmail.com> | 2020-04-28 08:32:13 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-04-28 08:35:34 +0930 |
commit | 48e5bada0aa8dacfbdee9700638fb20f5c17e55f (patch) | |
tree | 0923638e34ff1fd87f4fdce47976d0c8dae4b8ad | |
parent | 251dae91074170036c1a76c5e5df1f45197d7feb (diff) | |
download | gdb-48e5bada0aa8dacfbdee9700638fb20f5c17e55f.zip gdb-48e5bada0aa8dacfbdee9700638fb20f5c17e55f.tar.gz gdb-48e5bada0aa8dacfbdee9700638fb20f5c17e55f.tar.bz2 |
alpha-vms: divide by zero
The zero check was on the wrong operand. And, yes, the second operand
popped is supposed to be divided by the first operand popped.
* vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
Emit warning message.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/vms-alpha.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0a0995e..054aa32 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-04-28 Alan Modra <amodra@gmail.com> + + * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check. + Emit warning message. + 2020-04-27 Tamar Christina <tamar.christina@arm.com> * coff-i386.c (COFF_WITH_PE_BIGOBJ): New. diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 713697a..8e923d2 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -2438,8 +2438,11 @@ _bfd_vms_slurp_etir (bfd *abfd, struct bfd_link_info *info) return FALSE; if (rel1 != RELC_NONE || rel2 != RELC_NONE) goto bad_context; - if (op2 == 0) + if (op1 == 0) { + /* Divide by zero is supposed to give a result of zero, + and a non-fatal warning message. */ + _bfd_error_handler (_("%s divide by zero"), "ETIR__C_OPR_DIV"); if (!_bfd_vms_push (abfd, 0, RELC_NONE)) return FALSE; } |