Skip to content

[XC] fix excessive boxing#26465

Merged
mattleibow merged 1 commit intomainfrom
fix_26206
Dec 19, 2024
Merged

[XC] fix excessive boxing#26465
mattleibow merged 1 commit intomainfrom
fix_26206

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Contributor

Description of Change

a wrong test in some of the case was generating slightly invalid IL, that happened to crash on certain runtimes

Issues Fixed

Copy link
Copy Markdown
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing it, but the code here looks equivalent? Instead of casting twice, you use a previous result and things like that...

What is the difference in behaviour with the before and after?

If this was a code cleanup, then it looks close. But supposedly this fixes an issue so something has changed with the behaviour?

@StephaneDelcroix
Copy link
Copy Markdown
Contributor Author

StephaneDelcroix commented Dec 16, 2024

What is the difference in behaviour with the before and after?

before

	.locals /* 11000008 */ init (
...
		[6] float64
	)
...
	IL_0088: ldc.r8 25
	IL_0091: box [System.Runtime]System.Double /* 0100004A */
	IL_0096: stloc.s 6

this IL box before storing to a value type variable, which is wrong, the code decompiles with //IL_0098: Expected F8, but got O

after

	IL_0001: ldc.r8 25
	IL_000a: stloc.s 6

and no decompilation error

@mattleibow mattleibow merged commit 42c0809 into main Dec 19, 2024
@mattleibow mattleibow deleted the fix_26206 branch December 19, 2024 18:47
@kubaflo kubaflo mentioned this pull request Dec 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-xaml XAML, CSS, Triggers, Behaviors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Local resources not working in release configuration with more than one resource inside

3 participants