Skip to content

[Truffle] Breaking outer while loop fails #2675

@bjfish

Description

@bjfish

This causes array#cycle spec to fail

def yield_me
  n = 0
  while true
    [0, 1, 2].each do |n|
      puts "hello"
      yield(n)
      puts "shouldn't print this"
    end
  end
end

yield_me { |n| break if n == 0 }

Expected output (ruby 2.2, jruby )

$ ruby looping.rb 
hello

Actual output

$ ~/Documents/jruby-mine/bin/jruby -X+T -Xtruffle.printRuntime=true looping.rb
jruby: using Default Truffle Runtime
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello

... forever

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions