Project

General

Profile

Actions

Bug #12613

closed

Updated by dioni21 (Joao Carlos Mendes Luis) almost 9 years ago

If I change the second "retry" for "redo", it works...

If I remove the surrounding while loop, this error is raised:

Invalid retry (SyntaxError)

Updated by ko1 (Koichi Sasada) almost 9 years ago

  • Assignee set to ko1 (Koichi Sasada)

Updated by bkutil (Balazs Kutil) over 8 years ago

This code has the same symptoms. Removing the second begin/rescue, the method, or the return statement makes the code work (reports SyntaxError, without crashing).

#!/usr/bin/env ruby

def test
  begin
    break
  rescue
    # NOOP
  end

  return if true

  begin
    # Test
  rescue
    # NOOP
  end
end

Error:

[BUG] iseq_set_sequence: adjust bug -1 < 0)

On versions:

  • ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
  • ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]

Rubies 2.2.4 and earlier also warn about invalid break, before crashing.

  • ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin16]
  • ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-darwin16.0]
  • ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-darwin16.3.0]
./break_fail.rb:5: Invalid break
./break_fail.rb: [BUG] iseq_set_sequence: adjust bug

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Status changed from Open to Closed

Applied in changeset r57300.


compile.c: check compile

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Description updated (diff)
  • Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED

r57368 would be better, to backport at least.

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED

ruby_2_3 r57572 merged revision(s) 57368.

Updated by naruse (Yui NARUSE) over 8 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE, 2.4: DONE

ruby_2_4 r57854 merged revision(s) 57300,57368.

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE, 2.4: DONE to 2.1: REQUIRED, 2.2: DONE, 2.3: DONE, 2.4: DONE

ruby_2_2 r58090 merged revision(s) 57368.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0