code: plan9front

Download patch

ref: 2731ae50d3226381f2151b590f8f4f5c52545e5f
parent: 31bb950b7016f27ae1e766aafe5bedc605e803cf
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Oct 17 15:52:28 EDT 2021

libaml: resolve refs in ObjectType instruction

The standard states in section 19.5.93:

.... Notice that if this operation is performed
on an obeject reference such as one produced by
the Alias, Index, or RefOf statements, the obect
type of the base object is returned.

--- a/sys/src/libaml/aml.c
+++ b/sys/src/libaml/aml.c
@@ -1800,7 +1800,7 @@
 	while(r != nil){
 		switch(TAG(r)){
 		case 'R': case 'A': case 'L':	/* Ref */
-			r = ((Ref*)r)->ref;
+			r = *((Ref*)r)->ptr;
 			continue;
 		case 'N':			/* Name */
 			r = ((Name*)r)->v;