aml-build: don't modify child
commit7d433b0d85eba3d5083be6b74fd111f6de4ee373
authorMichael S. Tsirkin <mst@redhat.com>
Sat, 7 Mar 2015 19:47:51 +0000 (7 20:47 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 10 Mar 2015 15:09:58 +0000 (10 16:09 +0100)
tree652e7675a51d22c1e96568024f36e06fc763152c
parent8437f7be3b1c49631e435c652707f2cee477149d
aml-build: don't modify child

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 <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/acpi/aml-build.c