Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Issue 13661 - static array init does not call destructors #1006

Merged
merged 1 commit into from Nov 20, 2014

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Oct 31, 2014

https://issues.dlang.org/show_bug.cgi?id=13661

Add internal functions to handle assignment from an array with rvalue elements.

@9rnsr
Copy link
Contributor Author

9rnsr commented Oct 31, 2014

Necessary for compiler fix: dlang/dmd#4100

@MartinNowak
Copy link
Member

You could you forward _d_arrayassign to _d_arrayassign_l.

// Keep for backward binary compatibility. This function can be removed in the future.
extern (C) void[] _d_arrayassign(TypeInfo ti, void[] src, void[] dst)
{
    auto element_size = ti.tsize;

    // Need a temporary buffer tmp[] big enough to hold one element
    void[16] buf = void;
    void* tmp = element_size > buf.sizeof ? alloca(element_size) : buf.ptr;
    _d_arrayassign(ti, src, dst, tmp);
}

Add internal functions to handle assignment from an array with rvalue elements.
@9rnsr
Copy link
Contributor Author

9rnsr commented Nov 1, 2014

@MartinNowak Good idea. Fixed.

@MartinNowak
Copy link
Member

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request Nov 20, 2014
Issue 13661 - static array init does not call destructors
@MartinNowak MartinNowak merged commit 2a3f73c into dlang:master Nov 20, 2014
@9rnsr
Copy link
Contributor Author

9rnsr commented Nov 20, 2014

Thanks!

@9rnsr 9rnsr deleted the fix13661 branch November 23, 2014 01:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants