X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fex.cpp;h=474b9fd3e075a6d26180a874334d88522700b83e;hp=5c6853a766bb8e9b27bf59b08b3215e0f627b011;hb=be6cad814c18ff39f4e16c32441e98e6d72f32d4;hpb=cb289f8416f0bca370cc6a818380a7b52c41a92b diff --git a/ginac/ex.cpp b/ginac/ex.cpp index 5c6853a7..474b9fd3 100644 --- a/ginac/ex.cpp +++ b/ginac/ex.cpp @@ -482,8 +482,10 @@ void ex::construct_from_basic(const basic & other) } } else { if (other.flags & status_flags::dynallocated) { + // it's on the heap, so just copy bp: bp = &const_cast(other); } else { + // create a duplicate on the heap: bp = other.duplicate(); bp->setflag(status_flags::dynallocated); }