Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ia64/unwind Instead of testing for unsigned < 0, co...



details:   https://anonhg.NetBSD.org/src/rev/dbca1e552ebe
branches:  trunk
changeset: 816888:dbca1e552ebe
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Jul 31 19:12:41 2016 +0000

description:
Instead of testing for unsigned < 0, compare before subtracting.
Reset of PR 51297 from David Binderman.

diffstat:

 sys/arch/ia64/unwind/stackframe.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r caa9e6cb09fb -r dbca1e552ebe sys/arch/ia64/unwind/stackframe.c
--- a/sys/arch/ia64/unwind/stackframe.c Sun Jul 31 19:10:54 2016 +0000
+++ b/sys/arch/ia64/unwind/stackframe.c Sun Jul 31 19:12:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stackframe.c,v 1.6 2016/07/31 19:10:54 dholland Exp $  */
+/*     $NetBSD: stackframe.c,v 1.7 2016/07/31 19:12:41 dholland Exp $  */
 
 /* Contributed to the NetBSD foundation by Cherry G. Mathew <cherry%mahiti.org@localhost>
  * This file contains routines to use decoded unwind descriptor entries
@@ -946,8 +946,8 @@
                switch (rchain[i].type) {
                case R1:
                        rlen = rchain[i].udesc.R1.rlen;
+                       if (procoffset < roffset) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        rdepth = procoffset - roffset;
-                       if (rdepth < 0) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        roffset += rlen;
                        rtype = rchain[i].udesc.R1.r;
                        if (!rtype) {
@@ -957,8 +957,8 @@
 
                case R3:
                        rlen = rchain[i].udesc.R3.rlen;
+                       if (procoffset < roffset) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        rdepth = procoffset - roffset;
-                       if (rdepth < 0) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        roffset += rlen;
                        rtype = rchain[i].udesc.R3.r;
                        if (!rtype) {
@@ -968,8 +968,8 @@
 
                case R2:
                        rlen = rchain[i].udesc.R2.rlen;
+                       if (procoffset < roffset) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        rdepth = procoffset - roffset;
-                       if (rdepth < 0) goto out; /* Overshot Region containing procoffset. Bailout. */ 
                        roffset += rlen;
                        rtype = false; /* prologue region */
                        pushrecord(&current_state);



Home | Main Index | Thread Index | Old Index