Bug 3853 - <> compiled incorrectly
Summary: <> compiled incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: VisualBasic ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-03-12 06:25 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2012-07-04 21:32 UTC (History)
3 users (show)

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


Attachments
test code (302 bytes, application/octet-stream)
2012-03-12 06:25 UTC, Rolf Bjarne Kvinge [MSFT]
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 Rolf Bjarne Kvinge [MSFT] 2012-03-12 06:25:09 UTC
Created attachment 1499 [details]
test code

Test code (also attached):


Public Class Main
	Public Shared Sub Main()
		Dim t As Integer = 0
		
		Do 
			If t <> 1 Then
				Console.WriteLine ("will this happen?")
				t = 1
				Continue Do
			End If
			Console.WriteLine ("this happened")
			Exit Do
		Loop

		Console.WriteLine ("this will never happen :(")
	End Sub
End Class
Comment 1 gsertgaert 2012-03-21 03:20:28 UTC
Sry but you misunderstood the problem with the code I submitted.
This is a more clear example than what I sent before:

Sub Main()

    MsgBox("Test")

    Do
        Continue Do
    Loop
End Sub

Error:
Continue Do sends control flow to the start of the sub. "Test" displays repeatedly. Only happens when both Do and Loop are unconditional.

Expected:
Continue Do should send control flow to Do. "Test" should display only once and then enter an infinite loop.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-03-22 20:02:29 UTC
You're quite right, thanks for the information.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2012-07-04 21:32:13 UTC
Fixed (master:  6cd7b47f1c4d53cc077935efd282782526167db3).