D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10017 - Can not assign to a Variant another Variant holding a bigger structure
Summary: Can not assign to a Variant another Variant holding a bigger structure
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks: 9122
  Show dependency treegraph
 
Reported: 2013-05-02 10:31 UTC by Tavi Cacina
Modified: 2013-08-04 10:30 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tavi Cacina 2013-05-02 10:31:15 UTC
---
import std.variant;

struct S
{
  int[9] s;
}

void main()
{
  Variant v1, v2; // maximum payload size 32 bytes
  v1 = S(); // OK, the payload is allocated with new
  v2 = v1; // AssertError: target must be non-null
}
---


This error affects also the max size of a std.concurrency message, see #9122.
Comment 3 David Eagen 2013-05-27 18:08:14 UTC
This fixes the problem for me on x86_64 Linux.

Thank you!
Comment 4 Martin Krejcirik 2013-05-29 08:23:12 UTC
Still doesn't work on linux 32 bit.
Comment 5 Martin Nowak 2013-05-29 09:04:11 UTC
(In reply to comment #4)
> Still doesn't work on linux 32 bit.

Do you still get the "target must be non-null" error?
Are you sure you are using dmd's HEAD version?
Comment 6 Martin Nowak 2013-05-29 09:55:40 UTC
This was only merged into the master branch but not into 2.063.
Comment 7 Martin Krejcirik 2013-05-29 15:47:28 UTC
You are right, sorry for the confusion.
Comment 8 Martin Nowak 2013-05-29 17:59:37 UTC
(In reply to comment #7)
> You are right, sorry for the confusion.

It should have been merged into 2.063 though because bug 9122 was marked as regression.
Comment 9 github-bugzilla 2013-05-29 18:56:46 UTC
Commit pushed to 2.063 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/9a7627776e7cffa999f30e5a7450fb7f044a12f7
Merge pull request #1312 from dawgfoto/fix10017

fix issue 10017
Comment 10 Kenji Hara 2013-05-29 18:57:19 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > You are right, sorry for the confusion.
> 
> It should have been merged into 2.063 though because bug 9122 was marked as
> regression.

Ok. I pushed the fix to 2.063 branch.
Comment 11 David Eagen 2013-05-31 19:00:23 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > You are right, sorry for the confusion.
> > 
> > It should have been merged into 2.063 though because bug 9122 was marked as
> > regression.
> 
> Ok. I pushed the fix to 2.063 branch.

Looks like the fix isn't in the 2.063 release binaries. At least not the Linux 64-bit ones.
Comment 12 sumitraja 2013-07-29 19:47:30 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #8)
> > > (In reply to comment #7)
> > > > You are right, sorry for the confusion.
> > > 
> > > It should have been merged into 2.063 though because bug 9122 was marked as
> > > regression.
> > 
> > Ok. I pushed the fix to 2.063 branch.
> 
> Looks like the fix isn't in the 2.063 release binaries. At least not the Linux
> 64-bit ones.

Doesn't seem to be in the Windows 32-bit 2.063 release binaries either.