From 73a5351e91094758b06b1c118e6d5df4cfd48358 Mon Sep 17 00:00:00 2001 From: yasuoka Date: Thu, 18 Mar 2021 00:17:26 +0000 Subject: [PATCH] Fix previous (1.258). It breaks if localX itself is an object reference. found and test by Rafael Avila de Espindola ok kettenis --- sys/dev/acpi/dsdt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index e44f449dc12..f25ab28968a 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.260 2021/03/10 22:20:44 tobhe Exp $ */ +/* $OpenBSD: dsdt.c,v 1.261 2021/03/18 00:17:26 yasuoka Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -2961,10 +2961,13 @@ aml_store(struct aml_scope *scope, struct aml_value *lhs , int64_t ival, aml_rwfield(rhs, 0, rhs->v_field.bitlen, &tmp, ACPI_IOREAD); rhs = &tmp; } + /* Store to LocalX: free value */ + if (lhs->stack >= AMLOP_LOCAL0 && lhs->stack <= AMLOP_LOCAL7) + aml_freevalue(lhs); lhs = aml_gettgt(lhs, AMLOP_STORE); - /* Store to LocalX: free value */ + /* Store to LocalX: free value again */ if (lhs->stack >= AMLOP_LOCAL0 && lhs->stack <= AMLOP_LOCAL7) aml_freevalue(lhs); switch (lhs->type) { -- 2.20.1