Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hard crash when naming event :transition #10

Closed
kjwierenga opened this issue May 15, 2014 · 0 comments
Closed

hard crash when naming event :transition #10

kjwierenga opened this issue May 15, 2014 · 0 comments

Comments

@kjwierenga
Copy link

Apparently :transition is not a valid event name. Rather than crashing the ruby interpreter it would be nice to get an exception.

require 'finite_machine'

fsm = FiniteMachine.define do
  event :transition, :a => :b
end

fsm.transition
$ ruby examples/finite_machine/callbacks.rb 
/Users/kjw/.rvm/gems/ruby-1.9.3-p484@fsmtalk/gems/finite_machine-0.6.1/lib/finite_machine/transition.rb:130: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin12.5.0]

-- Control frame information -----------------------------------------------
c:2657 p:0018 s:9297 b:7969 l:001468 d:007968 LAMBDA /Users/kjw/.rvm/gems/ruby-1.9.3-p484@fsmtalk/gems/finite_machine-0.6.1/lib/finite_machine/transition.rb:130
c:2656 p:---- s:7965 b:7965 l:007964 d:007964 FINISH

It looks like this code results in infinite recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant