From owner-acpi-jp@jp.freebsd.org  Fri Feb  4 15:32:54 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id PAA95323;
	Fri, 4 Feb 2000 15:32:54 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (root@shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id PAA95318
	for <acpi-jp@jp.freebsd.org>; Fri, 4 Feb 2000 15:32:53 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1])
	by shidahara1.planet.sci.kobe-u.ac.jp (8.8.8+2.7Wbeta7/8.8.8) with ESMTP id PAA26071
	for <acpi-jp@jp.freebsd.org>; Fri, 4 Feb 2000 15:32:14 +0900 (JST)
Message-Id: <200002040632.PAA26071@shidahara1.planet.sci.kobe-u.ac.jp>
To: acpi-jp@jp.freebsd.org
Date: Fri, 04 Feb 2000 15:32:13 +0900
From: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: acpi-jp 259
Subject: [acpi-jp 259] Bug in Index()
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: takawata@shidahara1.planet.sci.kobe-u.ac.jp

Refof $B%*%Z%l!<%7%g%s$NJQ99$G%P%0$,$G$F$^$7$?!#(B
$B%9%?%C%/>e$N%]%$%s%?$r9=B$BN$NCf$K$$$l$FJV$7$F$$$k0Y(B
$B%G!<%?$,2=$1$F$^$9!#$H$j$"$($:(Bmalloc$B$G3NJ]$7$?$i(B
$BD>$j$^$7$?$,!"$3$l$G$O%a%b%j%j!<%/$7$F$7$^$$$^$9!#(B
$BNI$$J}K!$O$J$$$G$7$g$&$+!#(B


$BEOJUB:5*(B
$B?@8MBg3XBg3X1!<+A32J3X8&5f2J(BD2$B>pJs%a%G%#%"2J3X@l96(B
<a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">
Public Key</a>
Key fingerprint =  2C 51 E2 78 2C E1 C5 2D  0F F1 20 A3 11 3A 62 2A 



Index: parse.c
===================================================================
RCS file: /home/cvs/ACPI/util/acpiconf/parse.c,v
retrieving revision 1.17
diff -u -r1.17 parse.c
--- parse.c	2000/01/27 16:00:14	1.17
+++ parse.c	2000/02/04 06:27:34
@@ -1442,23 +1442,23 @@
 		break;
 	case 0x83:		/* DerefOp */
 	{
-		union aml_object	*objref;
+		union aml_object	*objref,*ref;
 
 		DPRINT("DerefOf(");
 		objref = acpi_eval_name(env, acpi_parse_termobj(env, indent));
 		DPRINT(")");
-
-		if ((*(objref->objref.ref)) == NULL) {
+		ref=*objref->objref.ref;
+		if (ref == NULL) {
 			env->work.property = *(objref->objref.ref);
 			aname = &env->work;
 			break;
 		}
 
-		switch ((*(objref->objref.ref))->type) {
+		switch (ref->type) {
 		case aml_t_package:
 		case aml_t_buffer:
 			if (objref->objref.offset < 0) {
-				env->work.property = *(objref->objref.ref);
+				env->work.property = ref;
 				if (objref != &env->wobj) {
 					acpi_free_object(&objref);
 				}
@@ -1468,7 +1468,7 @@
 			}
 			break;
 		default:
-			env->work.property = *(objref->objref.ref);
+			env->work.property = ref;
 			break;
 		}
 
@@ -1531,7 +1531,8 @@
 		case aml_t_buffer:
 			objref = acpi_alloc_object(aml_t_objref, NULL);
 			acpi_register_temporary_object(env, objref);
-			objref->objref.ref = &srcobj;
+			objref->objref.ref = malloc(sizeof(&srcobj));
+			*objref->objref.ref=srcobj;
 			objref->objref.offset = num1;
 			objref->objref.deref = 0;
 			break;

