From 2416d84a4fe52a9ff2dea3972ee0721c5bfabea9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Tue, 27 Jan 1998 12:02:15 -0800
Subject: [PATCH] core-dumping bug fixed

Rev: src/language.yacc:1.56
Rev: src/program.c:1.57
---
 src/language.yacc | 14 ++++----------
 src/program.c     | 11 ++++++++---
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/language.yacc b/src/language.yacc
index 24e77a9118..6f137c8059 100644
--- a/src/language.yacc
+++ b/src/language.yacc
@@ -161,7 +161,7 @@
 /* This is the grammar definition of Pike. */
 
 #include "global.h"
-RCSID("$Id: language.yacc,v 1.55 1998/01/26 19:59:54 hubbe Exp $");
+RCSID("$Id: language.yacc,v 1.56 1998/01/27 20:02:14 hubbe Exp $");
 #ifdef HAVE_MEMORY_H
 #include <memory.h>
 #endif
@@ -1474,15 +1474,9 @@ void yyerror(char *str)
 
   if ( get_master() )
   {
-    sp->type = T_STRING;
-    copy_shared_string(sp->u.string, lex.current_file);
-    sp++;
-    sp->type = T_INT;
-    sp->u.integer = lex.current_line;
-    sp++;
-    sp->type = T_STRING;
-    sp->u.string = make_shared_string(str);
-    sp++;
+    ref_push_string(lex.current_file);
+    push_int(lex.current_line);
+    push_text(str);
     SAFE_APPLY_MASTER("compile_error",3);
     pop_stack();
   }else{
diff --git a/src/program.c b/src/program.c
index 797b05b549..4a101fc72b 100644
--- a/src/program.c
+++ b/src/program.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: program.c,v 1.56 1998/01/27 18:11:35 hubbe Exp $");
+RCSID("$Id: program.c,v 1.57 1998/01/27 20:02:15 hubbe Exp $");
 #include "program.h"
 #include "object.h"
 #include "dynamic_buffer.h"
@@ -1011,6 +1011,11 @@ void compiler_do_inherit(node *n,
 			 INT32 flags,
 			 struct pike_string *name)
 {
+  if(!n)
+  {
+    yyerror("Unable to inherit");
+    return;
+  }
   switch(n->token)
   {
     case F_EXTERNAL:
@@ -1029,10 +1034,10 @@ void compiler_do_inherit(node *n,
     
       if(IDENTIFIER_IS_CONSTANT(i->identifier_flags))
       {
-	struct svalue *s=PROG_FROM_INT(new_program, numid)->constants + i->func.offset;
+	struct svalue *s=PROG_FROM_INT(p, numid)->constants + i->func.offset;
 	if(s->type != T_PROGRAM)
 	{
-	  yyerror("Inherit identifier is not a program");
+	  do_inherit(s,flags,name);
 	  return;
 	}else{
 	  p=s->u.program;
-- 
GitLab