Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed objects being erroneously zeroed out before object construction #12814

Merged
merged 1 commit into from
Dec 5, 2019
Merged

Conversation

nc-x
Copy link
Contributor

@nc-x nc-x commented Dec 5, 2019

Closes #12753

@mratsim
Copy link
Collaborator

mratsim commented Dec 5, 2019

It might fix much more than that.

I've always been annoyed by the double zeroMem that required {.noinit.} and it might be the same thing that triggers double zeroMem.

So potentially related:

See the double memset in the last one:

N_NIMCALL(void, boo2_9aSl0jzccntfjPB4osXEnHA_3)(tyObject_Foo_Bsmztv1sSxNkRrfi5afFAg* Result) {
	tyObject_Foo_Bsmztv1sSxNkRrfi5afFAg a;
	memset((void*)(&a), 0, sizeof(a));
	memset((void*)(&a), 0, sizeof(a));
	newFoo_9aSl0jzccntfjPB4osXEnHA_2((&a));
	genericSeqAssign((&(*Result).s), a.s, (&NTI_qwqHTkRvwhrRyENtudHQ7g_));
	(*Result).val = a.val;
}

@Araq
Copy link
Member

Araq commented Dec 5, 2019

There already is a isPartOf check that should be fixed, maybe. Have you looked into it?

@Araq Araq merged commit 1db2172 into nim-lang:devel Dec 5, 2019
@nc-x nc-x deleted the i12753 branch December 6, 2019 12:50
narimiran pushed a commit to narimiran/Nim that referenced this pull request Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assignment of objects erroneously zeroed LHS before object construction on the RHS
3 participants