libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] _ReadSLEB and _ReadULEB


From: David Mosberger
Subject: Re: [libunwind] _ReadSLEB and _ReadULEB
Date: Fri, 18 Feb 2005 22:20:23 -0800

>>>>> On Wed, 16 Feb 2005 09:46:34 +0100, Tommy Hoffner <address@hidden> said:

  Tommy> Secondly, since name resolution in dynamic libraries isn't
  Tommy> the most predictable activity that I know: Can you verify
  Tommy> that your build/run results in Intel's personality routine
  Tommy> calling your _ReadSLEB?

That was it.  It picked up the symbol from libunwind.so.6.  I was able
to reproduce the bug with LD_PRELOAD=/lib/libunwind.so.7.

It turns out there was a stupid typo in _ReadSLEB().  Patch is
attached below.

Matthieu: what should we do about the Debian packages?  Perhaps it's
best if I wait for another week or so and if nothing else shows up
release this as 0.98.4?

        --david

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/02/18 22:15:20-08:00 address@hidden 
#   (_ReadSLEB): Fix typo.
# 
# src/mi/_ReadSLEB.c
#   2005/02/18 22:15:19-08:00 address@hidden +1 -1
#   (_ReadSLEB): Fix typo: shift needs to be increment before checking
#       for loop-exit.  Otherwise, sign-extension may clobber the
#       most recently read 7 bits.
# 
diff -Nru a/src/mi/_ReadSLEB.c b/src/mi/_ReadSLEB.c
--- a/src/mi/_ReadSLEB.c        2005-02-18 22:16:46 -08:00
+++ b/src/mi/_ReadSLEB.c        2005-02-18 22:16:46 -08:00
@@ -11,9 +11,9 @@
     {
       byte = *bp++;
       result |= (byte & 0x7f) << shift;
+      shift += 7;
       if ((byte & 0x80) == 0)
        break;
-      shift += 7;
     }
 
   if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]