Menu

#947 Empty sections will cause segfault

closed-accepted
2
2013-05-25
2005-07-04
riedel
No

I suggest the following patch. I really needed I can isolate
the faulting code (== work).

Index: src/pic16/device.c

RCS file: /cvsroot/sdcc/sdcc/src/pic16/device.c,v
retrieving revision 1.39
diff -u -r1.39 device.c
--- src/pic16/device.c 24 Jun 2005 14:19:36 -0000 1.39
+++ src/pic16/device.c 4 Jul 2005 12:41:57 -0000
@@ -681,6 +681,7 @@
regs *r1;

/* put all symbols in an array */
+ if(!elementsInSet(section)) return;
rlist = Safe_calloc(elementsInSet(section),
sizeof(regs *));
r = rlist[0]; i = 0;
for(rprev = setFirstItem(section); rprev; rprev =
setNextItem(section)) {
@@ -779,6 +780,7 @@
symbol **slist;

/* put all symbols in an array */
+ if(!elementsInSet(section)) return;
slist = Safe_calloc(elementsInSet(section),
sizeof(symbol *));
s = slist[0]; i = 0;
for(sprev = setFirstItem(section); sprev; sprev =
setNextItem(section)) {
@@ -863,6 +865,7 @@
regs **rlist;

/* put all symbols in an array */
+ if(!elementsInSet(section)) return;
rlist = Safe_calloc(elementsInSet(section),
sizeof(regs *));
r = rlist[0]; i = 0;
for(rprev = setFirstItem(section); rprev; rprev =
setNextItem(section)) {

Discussion

  • riedel

    riedel - 2005-07-04
    • priority: 5 --> 2
    • summary: Empty segments will cause segfault --> Empty sections will cause segfault
     
  • Raphael Neider

    Raphael Neider - 2005-07-21
    • milestone: --> fixed
    • assigned_to: nobody --> tecodev
    • status: open --> closed-accepted
     
  • Raphael Neider

    Raphael Neider - 2005-07-21

    Logged In: YES
    user_id=1115835

    Fixed in SDCC 2.5.1 #1062 with the supplied patch.

     

Log in to post a comment.