Hi list,

I ran into a nasty bug today:

csharp> LoadAssembly("Mono.Cecil.dll");
csharp> using Mono.Cecil;
csharp> AssemblyNameReference.Parse ("foo");
foo, Culture=neutral, PublicKeyToken=null
csharp> AssemblyNameReference.Parse ("/foo/bar");
/foo/bar, Culture=neutral, PublicKeyToken=null
csharp> AssemblyNameReference.Parse ("/foo/bar, baz/qux");
System.ArgumentException: Malformed name
  at Mono.Cecil.AssemblyNameReference.Parse (System.String fullName) 
[0x00000] in <filename unknown>:0 
  at Class3.Host (System.Object& $retval) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& 
result, System.Boolean& result_set) [0x00000] in <filename unknown>:0 
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename 
unknown>:0 
csharp>  

The issue is, of course, that the interpretation of the name is ambiguous.

I'm not sure what the best fix for this would be. The first thing that hit 
me was "well, if the next token we encounter is not culture, 
publickeytoken, nor version, we can just parse that token as an extra part 
of the name". But if a path for some reason contains those words in it, 
that would break too (granted, low chance). So I thought, "we could allow 
quoted paths". But that opens a can of worms in case a quoted path 
contains... a quote.

Blergh. Any ideas?

Regards,
Alex

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to