This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH for 980308 Interal Compiler Error
- To: Phil <tmwg at inxservices dot com>
- Subject: PATCH for 980308 Interal Compiler Error
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Wed, 11 Mar 1998 17:49:24 GMT
- Cc: egcs-bugs at cygnus dot com
- References: <19980311145244.54396@inxservices.com>
- Reply-To: mmitchell at usa dot net
Here's a patch for your problem. Jason, is this OK?
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu
#include <cctype>
#include <time.h>
void f() {
char buffer[32];
tm entered;
bool is_valid;
entered->tm_mon = int(buffer[0] - '0');
}
Wed Mar 11 17:47:19 1998 Mark Mitchell <mmitchell@usa.net>
* typeck2.c (build_x_arrow): Don't crash if no overloaded
operator-> is available for an aggregate type.
Index: typeck2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck2.c,v
retrieving revision 1.14
diff -c -p -r1.14 typeck2.c
*** typeck2.c 1998/03/03 22:27:04 1.14
--- typeck2.c 1998/03/12 01:43:32
*************** build_x_arrow (datum)
*** 1315,1320 ****
--- 1315,1327 ----
}
last_rval = rval;
}
+
+ if (last_rval == NULL_TREE)
+ {
+ error ("base operand of `->' is not a pointer");
+ return error_mark_node;
+ }
+
if (TREE_CODE (TREE_TYPE (last_rval)) == REFERENCE_TYPE)
last_rval = convert_from_reference (last_rval);
}