[erlang-questions] Why the code will make erlang crash?
LUKE
luke@REDACTED
Thu Nov 15 08:18:49 CET 2007
-module(libstr).
-export([exists/2]).
exists(String,MString)->
case regexp:match(String,"(^" ++ MString ++ "*)") of
{match,_,_}->true;
nomatch->false;
{error,Why}->Why
end.
=============================================
4> libstr:exists("hello","hel").
true
5> libstr:exists("hello","lo").
false
6> libstr:exists("hello","lo*").
false
7> libstr:exists("hello","*lo").
Crash dump was written to: erl_crash.dump
eheap_alloc: Cannot allocate 1140328500 bytes of memory (of type "heap").
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071115/f572c608/attachment.htm>
More information about the erlang-questions
mailing list