return early when pb or pb->pcHead is NULL (patch #
1708427)
* src/regression/empty.c,
* src/regression/Makefile: added test with empty functions
* support/Util/SDCCerr.c: fixed typo in E_INIT_STRUCT message
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4772
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2007-04-27 Raphael Neider <rneider AT web.de>
+
+ * src/pic/pcode.c (addpCode2pBlock,LinkFlow,pBlockRemoveUnusedLabels):
+ return early when pb or pb->pcHead is NULL (patch #1708427)
+ * src/regression/empty.c,
+ * src/regression/Makefile: added test with empty functions
+ * support/Util/SDCCerr.c: fixed typo in E_INIT_STRUCT message
+
2007-04-27 Borut Razem <borut.razem AT siol.net>
* src/SDCCast.c: fixed feature request
void addpCode2pBlock(pBlock *pb, pCode *pc)
{
- if(!pc)
+ if(!pb || !pc)
return;
if(!pb->pcHead) {
//fprintf(stderr,"linkflow \n");
+ if (!pb) return;
+
for( pcflow = findNextpCode(pb->pcHead, PC_FLOW);
pcflow != NULL;
pcflow = findNextpCode(pcflow->next, PC_FLOW) ) {
{
pCode *pc; pCodeLabel *pcl;
- if(!pb)
+ if(!pb || !pb->pcHead)
return;
for(pc = pb->pcHead; (pc=findNextInstruction(pc->next)) != NULL; ) {
compare8.c \
compare9.c \
configword.c \
+ empty.c \
for.c \
inline.c \
mult1.c \
--- /dev/null
+#include "gpsim_assert.h"
+
+unsigned char failures = 0;
+
+void foo(void) {
+}
+
+void bar(int arg0) {
+}
+
+void
+done()
+{
+ ASSERT(MANGLE(failures) == 0);
+ PASSED();
+}
+
+void main(void) {
+ done();
+}
+
{ E_INIT_COUNT, ERROR_LEVEL_ERROR,
"too many initializers" },
{ E_INIT_STRUCT, ERROR_LEVEL_ERROR,
- "struct/union/array '%s' :initialization needs curly braces" },
+ "struct/union/array '%s': initialization needs curly braces" },
{ E_INIT_NON_ADDR, ERROR_LEVEL_ERROR,
"non-address initialization expression" },
{ E_INT_DEFINED, ERROR_LEVEL_ERROR,