Bug 11750 - Mono changes its behavior in the presence or absence of Object.GetType calling.
Summary: Mono changes its behavior in the presence or absence of Object.GetType calling.
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-12 03:23 UTC by Hiroyuki Iwatsuki
Modified: 2013-04-19 03:04 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
test program (1.07 KB, text/plain)
2013-04-12 03:25 UTC, Hiroyuki Iwatsuki
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Hiroyuki Iwatsuki 2013-04-12 03:23:55 UTC
I wrote a program test.cs. This program does not work fine for me.

The result of this code is:

value(-1) <  -0x80 => False
value(-1) <  -0x20 => False
value(-1) <   0x80 => False
value(-1) <  0x100 => False

This is not correct.

However, uncomment "value.GetType();" in Tmp.Packer.PackInt16(),
or comment out "packer.PackObject((ushort)0);" in Tmp.Packer.Main(),
Then this program works fine.

value(-1) <  -0x80 => False
value(-1) <  -0x20 => False
value(-1) <   0x80 => True
value(-1) <  0x100 => True

Is this Mono's bug? Or my implementation is bad?

I tested with:

Mono JIT compiler version 3.0.3 (tarball Thu Apr 11 19:43:51 JST 2013) from FreeBSD ports on FreeBSD 9.1-STABLE
Mono JIT compiler version 3.0.6 (master/20e40c4 Wed Feb 27 10:15:23 EST 2013) from Official release on Mac OS X 10.7.5
Mono JIT compiler version 3.0.10 (master/add2135 2013年 4月12日 金曜日 14時20分10秒 JST) from GitHub on FreeBSD 9.1-STABLE

FYI, test.cs has no problem with Visual Studio 2008/2010/2012.

Please refer to http://qa.atmarkit.co.jp/q/2834 for details in Japanese.

Thanks,
Hiroyuki Iwatsuki
Comment 1 Hiroyuki Iwatsuki 2013-04-12 03:25:28 UTC
Created attachment 3804 [details]
test program

Sorry, I added test.cs.
Comment 2 Hiroyuki Iwatsuki 2013-04-16 01:33:44 UTC
Addition, I tested using Mono 2.10 on LiveWorkSpace.
This version (Mono 2.10) has same problem.

http://liveworkspace.org/code/yhxj$0

stdout: 
value(-1) <  -0x80 => False
value(-1) <  -0x20 => False
value(-1) <   0x80 => False
value(-1) <  0x100 => False
Comment 3 Zoltan Varga 2013-04-18 15:41:54 UTC
Fixed in master/2.10.
Comment 4 Hiroyuki Iwatsuki 2013-04-19 03:04:26 UTC
Thank you!