writing-a-compiler-in-ruby icon indicating copy to clipboard operation
writing-a-compiler-in-ruby copied to clipboard

Method call in method body (e.g: attr_accessor) causes "nested" calls

Open vidarh opened this issue 15 years ago • 1 comments

class Foo
  attr_accessor :seq
end

the attr_accessor bit turns into:

    # callm :self.:attr_accessor
    subl    $20, %esp
    movl    $2, %ebx
    movl    Foo, %eax
    movl    %eax, (%esp)
    movl    $3481, 4(%esp)
    movl    (%eax), %edx
    movl    12(%edx), %eax
    call    *%eax
    addl    $20, %esp
    # callm self.attr_accessor END
    call    *%eax

vidarh avatar May 27 '09 15:05 vidarh

(notice the second call &%eax)

vidarh avatar May 27 '09 15:05 vidarh