Skip to content

Instantly share code, notes, and snippets.

View dgrunwald's full-sized avatar

Daniel Grunwald dgrunwald

View GitHub Profile
@dgrunwald
dgrunwald / dup-stloc-jit-bug.il
Created November 1, 2017 00:25
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
}
.assembly extern System.Runtime
{
.publickeytoken = (
b0 3f 5f 7f 11 d5 0a 3a
)
.ver 4:2:0:0
}
.assembly extern System.Console
{
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 4:0:0:0
}
.assembly StackTests
{
.hash algorithm 0x00008004
.ver 1:0:4059:39717
}
using System;
using System.Collections.Generic;
class Program
{
public static void Main()
{
var la = new B2();
int ha;
"C:\Program Files (x86)\SharpDevelop\5.0\bin\..\bin\Tools\NUnit\nunit-console-x86.exe" "C:\work\SD5\bin\UnitTests\Debugger.Tests.dll" /noxml /pipe="97d81b0f-c2ca-45a8-a1cd-dd556f6a5c39" /run="Debugger.Tests.DebuggerTests.ControlFlow_Stepping"
NUnit-Console version 2.6.3.0
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
Copyright (C) 2006 Daniel Grunwald.
Copyright (C) 2006-2008 Matt Ward.
All Rights Reserved.
Runtime Environment -
@dgrunwald
dgrunwald / gist:8474772
Created January 17, 2014 14:59
Invalid code that messes up locations in NRefactory parser
using System;
using System.Linq;
class Test
{
public static Task<int> RunGitAsync(string workingDir, params string[] arguments)
{
string git = FindGit();
if (git == null)
return Task.FromResult(9009);
ProcessRunner p = new ProcessRunner();
################################ UNIT TESTS ################################
Running tests in 'C:\work\NRefactory\bin\Debug\ICSharpCode.NRefactory.Tests.dll'...
======================================================================
Starting new resolver for precedent => {
Console.WriteLine (precedent.IsFaulted);
}
Resolved 'int' to [TypeResolveResult System.Int32]
Resolved 'Task<int>' to [TypeResolveResult System.Threading.Tasks.Task`1[[System.Int32]]]
Resolved 'Task<int> foo = null;
' to [ResolveResult System.Void]
// Copyright (c) 2013 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
@dgrunwald
dgrunwald / ProcessRunner.cs
Created April 7, 2013 15:51
Replacement for System.Diagnostics.Process
// Copyright (c) 2013 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
class Program
{
public static void Main(string[] args)
{
bool b = false;
StringComparison s = 0;
var res = b ? 0.0f : s;
Console.WriteLine(res.GetType()); // prints System.StringComparison
}
}