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

Unexpected rest argument #3597

Closed
ksss opened this issue Apr 10, 2017 · 3 comments
Closed

Unexpected rest argument #3597

ksss opened this issue Apr 10, 2017 · 3 comments

Comments

@ksss
Copy link
Contributor

ksss commented Apr 10, 2017

from 5c114c9

build_config.rb

MRuby::Build.new do |conf|
  toolchain :gcc
  enable_debug
  conf.gembox 'default'
end
HEAD[5c114c91] ~/src/github.com/ksss/mruby
$ cat t.rb
#! /usr/bin/env ruby

def a(*args)
  p args
end

a :a, :b, :c, :d, :e, :f


HEAD[5c114c91] ~/src/github.com/ksss/mruby
$ ./build/host/bin/mruby -v t.rb
mruby 1.2.0 (2015-11-17)
00003 NODE_SCOPE:
00003   NODE_BEGIN:
00003     NODE_DEF:
00005       a
00003       local variables:
00003         args
00003       rest=*args
00004       NODE_BEGIN:
00004         NODE_FCALL:
00004           NODE_SELF
00004           method='p' (390)
00004           args:
00004             NODE_LVAR args
00007     NODE_FCALL:
00007       NODE_SELF
00007       method='a' (359)
00007       args:
00007         NODE_SYM :a (359)
00007         NODE_SYM :b (357)
00007         NODE_SYM :c (674)
00007         NODE_SYM :d (675)
00007         NODE_SYM :e (353)
00007         NODE_SYM :f (676)
irep 0x60c0000133c0 nregs=9 nlocals=1 pools=0 syms=6 reps=1
file: t.rb
    3 000 OP_TCLASS	R1
    3 001 OP_LAMBDA	R2	I(+1)	1
    3 002 OP_METHOD	R1	:a
    7 003 OP_LOADSELF	R1
    7 004 OP_LOADSYM	R2	:a
    7 005 OP_LOADSYM	R3	:b
    7 006 OP_LOADSYM	R4	:c
    7 007 OP_LOADSYM	R5	:d
    7 008 OP_LOADSYM	R6	:e
    7 009 OP_LOADSYM	R7	:f
    7 010 OP_SEND	R1	:a	6
    7 011 OP_STOP

irep 0x60c000013300 nregs=6 nlocals=3 pools=0 syms=1 reps=0
file: t.rb
    3 000 OP_ENTER	0:0:1:0:0:0:0
    4 001 OP_LOADSELF	R3
    4 002 OP_MOVE	R4	R1		; R1:args
    4 003 OP_SEND	R3	:p	1
    4 004 OP_RETURN	R3	return

[:a, :b, :c, :d, :e, nil]
@matz
Copy link
Member

matz commented Apr 10, 2017

It doesn't happen on me as of ab25eae.

@ksss
Copy link
Contributor Author

ksss commented Apr 10, 2017

@matz Sorry, I mistake the build_config.rb.

Would you try again?

MRuby::Build.new do |conf|
  toolchain :gcc
  enable_debug
  conf.gembox 'default'
  conf.cc.defines << %w(MRB_GC_STRESS)
end

@matz matz closed this as completed in 0048dd1 Apr 10, 2017
@ksss
Copy link
Contributor Author

ksss commented Apr 11, 2017

I confirmed that it has been fixed ✨

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

2 participants