From 8236f0017588c889e1836142b6e80097e887c963 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Wed, 15 Dec 2004 02:24:35 +0000 Subject: [PATCH] filter out invalid S_FUN entries svn path=/trunk/; revision=12128 --- reactos/tools/rsym.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/reactos/tools/rsym.c b/reactos/tools/rsym.c index 7b8924d8ad8..b9e7dbb6043 100644 --- a/reactos/tools/rsym.c +++ b/reactos/tools/rsym.c @@ -278,15 +278,23 @@ int main(int argc, char* argv[]) for (i = 0; i < SymbolsCount; i++) { - if (StabEntry[i].n_type == N_FUN || - StabEntry[i].n_type == N_SLINE || - StabEntry[i].n_type == N_SO) - { - memmove(&StabEntry[Count], &StabEntry[i], sizeof(STAB_ENTRY)); - if ( StabEntry[Count].n_value >= ImageBase ) - StabEntry[Count].n_value -= ImageBase; - Count++; - } + switch ( StabEntry[i].n_type ) + { + case N_FUN: + if ( StabEntry[i].n_desc == 0 ) // line # 0 isn't valid + continue; + break; + case N_SLINE: + break; + case N_SO: + break; + default: + continue; + } + memmove(&StabEntry[Count], &StabEntry[i], sizeof(STAB_ENTRY)); + if ( StabEntry[Count].n_value >= ImageBase ) + StabEntry[Count].n_value -= ImageBase; + Count++; } StrEntry = malloc(sizeof(STR_ENTRY) * Count);