PATCH: R13B01: new() function with module parameter variable(s) in guard crashes compiler

Yurii Rashkovskii <>
Mon Aug 17 15:36:22 CEST 2009


Currently, R13B01's compiler crashes on source code like this:


new() when P1 > 0 ->

The crash looks like this:

./somemodule.erl:none: internal error in core_dsetel_module;
crash reason: {{badmatch,error},

Attached you can find a quick patch that makes compiler emit an error  

./somemodule.erl:4: variable 'P1' is unbound

This patch is also available through this branch:

The solution in this patch might not be ideal, but it is a start; if  
OTP team will be interested in including it into official source code  
tree, I will be happy to spend a little bit more time to make it  
somewhat nicer.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler-new-guards-use-of-parameters.diff
Type: application/octet-stream
Size: 930 bytes
Desc: not available
URL: <>
-------------- next part --------------

More information about the erlang-patches mailing list