Skip to content

Instantly share code, notes, and snippets.

@dgrunwald
Created November 1, 2017 00:25
Show Gist options
  • Save dgrunwald/b0ca8412cd0ce4ebd1ad202427886129 to your computer and use it in GitHub Desktop.
Save dgrunwald/b0ca8412cd0ce4ebd1ad202427886129 to your computer and use it in GitHub Desktop.
Implicitly truncating stloc after dup seems to be miscompiled in RyuJIT
.assembly extern mscorlib
{
.publickeytoken = ( b7 7a 5c 56 19 34 e0 89 )
.ver 4:0:0:0
}
.assembly 'StackTypes'
{
.ver 0:0:0:0
}
.module StackTypes.exe
.corflags 0x00000001 // ILOnly
.class private auto ansi abstract sealed beforefieldinit Program
extends [mscorlib]System.Object
{
.method public hidebysig static void Main (string[] args) cil managed
{
.maxstack 8
.entrypoint
call void Program::InlineAssignByte()
//call void Program::Int32OrNativeTests()
ret
} // end of method Main
.method public static void InlineAssignByte()
{
.locals init (
int8 local
)
ldstr "InlineAssignByte: WriteLine(local = {0})"
ldc.i4 300
dup
stloc.0
box int32
call void [mscorlib]System.Console::WriteLine(string, object)
ldstr "InlineAssignByte: local is {0}"
ldloc.0
box int32
call void [mscorlib]System.Console::WriteLine(string, object)
ret
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment