Re: [Qemu-devel] [PATCH] aml-build: don't modify child

2015-03-09 Thread Igor Mammedov
On Mon, 9 Mar 2015 10:30:31 +0100 "Michael S. Tsirkin" wrote: > On Mon, Mar 09, 2015 at 10:27:15AM +0100, Igor Mammedov wrote: > > On Sat, 7 Mar 2015 20:51:33 +0100 > > "Michael S. Tsirkin" wrote: > > > > > this code: > > > aml_append(foo, bar); > > > > > > might, non-intuitively, modify b

Re: [Qemu-devel] [PATCH] aml-build: don't modify child

2015-03-09 Thread Michael S. Tsirkin
On Mon, Mar 09, 2015 at 10:27:15AM +0100, Igor Mammedov wrote: > On Sat, 7 Mar 2015 20:51:33 +0100 > "Michael S. Tsirkin" wrote: > > > this code: > > aml_append(foo, bar); > > > > might, non-intuitively, modify bar, which means that e.g. the following > > might not DTRT: > > > > c = ...

Re: [Qemu-devel] [PATCH] aml-build: don't modify child

2015-03-09 Thread Igor Mammedov
On Sat, 7 Mar 2015 20:51:33 +0100 "Michael S. Tsirkin" wrote: > this code: > aml_append(foo, bar); > > might, non-intuitively, modify bar, which means that e.g. the following > might not DTRT: > > c = ; > aml_append(a, c); > aml_append(b, c); > > to fix, simply allocate an

[Qemu-devel] [PATCH] aml-build: don't modify child

2015-03-07 Thread Michael S. Tsirkin
this code: aml_append(foo, bar); might, non-intuitively, modify bar, which means that e.g. the following might not DTRT: c = ; aml_append(a, c); aml_append(b, c); to fix, simply allocate an intermediate array, and always modify that. Signed-off-by: Michael S. Tsirkin --- h