[Mono-list] Strange switch issue
Nicola Dell'Amico
webring at ndatech.it
Wed Feb 20 14:07:19 EST 2008
Hi,
while writing a simple script parser and runtime engine, I coped with a
compiler exception. The exception was caused by the duplicate case int
the switch statement.
That is quite strange and related to that peace of specific code,
because I tried to reproduce the same with other code but with no effect
(the compiler correctly signals an error and doesn't crash).
So I attached the faulty peace of code (a snippet from my whole project).
Sadly , Monodevelop 0.18 doesn't report any error into the Error List !!
while in Build Output the exception output was shown: I had hard time
figuring out my code was faulty !
That's the Monodevelop Build Output:
Building Project: test (Debug)
Performing main compilation...
Exception caught by the compiler while compiling:
Block that caused the problem begin at:
/home/#########/test/Main.cs(34,29):
Block being compiled:
[/home/#########/test/Main.cs(54,33):,Internal(1,1):]
System.NullReferenceException: Object reference not set to an instance
of an object
Internal compiler error at /home/#########/test/Main.cs(34,29)::
exception caught while emitting MethodBuilder [MainClass::Parse]
Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
at Mono.CSharp.EnumMember.get_Value () [0x00000]
at Mono.CSharp.Enum.GetDefinition (System.Object value) [0x00000]
at Mono.CSharp.TypeManager.CSharpEnumValue (System.Type t,
System.Object value) [0x00000]
at Mono.CSharp.SwitchLabel.Erorr_AlreadyOccurs (System.Type
switch_type, Mono.CSharp.SwitchLabel collision_with) [0x00000]
at Mono.CSharp.Switch.CheckSwitch (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Switch.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.While.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block,
Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable)
[0x00000]
Build complete -- 0 errors, 0 warnings
---------------------- Done ----------------------
Build successful.
Mono version is:
#########@openSUSE-Dev:~> mono --version
Mono JIT compiler version 1.2.6 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: normal
Notifications: epoll
Architecture: x86
Disabled: none
System is :
#########@openSUSE-Dev:~> uname -a
Linux openSUSE-Dev 2.6.22.17-0.1-default #1 SMP 2008/02/10 20:01:04 UTC
i686 athlon i386 GNU/Linux
Hope this could help.
Nicola
---
http://www.ndatech.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.cs
Type: text/x-csharp
Size: 1568 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20080220/f584a08e/attachment-0001.bin
More information about the Mono-list
mailing list