Bug 21685 - Reading bool pointers only takes into account the first bit
Summary: Reading bool pointers only takes into account the first bit
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-07-30 07:21 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2014-07-31 12:41 UTC (History)
3 users (show)

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

test.cs (540 bytes, application/octet-stream)
2014-07-30 07:21 UTC, Rolf Bjarne Kvinge [MSFT]

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:

Description Rolf Bjarne Kvinge [MSFT] 2014-07-30 07:21:32 UTC
Created attachment 7531 [details]

Run attached test case.

The output in mono will be intermittent True/False, with True for every odd number:

#0 = False
#1 = True
#2 = False
#3 = True

The output for MS is False for #0, and True for the rest:

#0 = False
#1 = True
#2 = True
#3 = True

> mono --version
Mono JIT compiler version 3.6.1 ((no/9d8be3d Sun Jul 27 20:49:44 EDT 2014)

I also tried with the tip of mono-3.6.0-branch and mono-3.4.0-branch, and both fail the test case.
Comment 1 Marek Safar 2014-07-31 12:41:34 UTC
Fixed in master and 3.8 branch