This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH for 980308 Interal Compiler Error



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);
      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]