Skip to content

Commit

Permalink
pop receiver when evaliing lvar as method call;
Browse files Browse the repository at this point in the history
dup argument ini putstring;
call :to_s on a string in tostring
  • Loading branch information
iliabylich committed Jan 3, 2020
1 parent bceb7ff commit f8903e3
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 40 deletions.
5 changes: 3 additions & 2 deletions executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def execute_opt_send_without_block((options, _flag))
(local = vm.frame_stack.closest(&:eval?).locals.find_if_declared(name: mid))

# x = 1; eval("x") - x is a VCALL in eval, so maybe it's a local variable of the parent frame
_recv = pop
result = local.value
push(result)
return
Expand Down Expand Up @@ -515,7 +516,7 @@ def execute_newarray((size))
end

def execute_putstring((string))
push(string)
push(string.dup)
end

def execute_splatarray((_flag))
Expand Down Expand Up @@ -674,7 +675,7 @@ def execute_setn((n))
def execute_tostring(*)
str = pop
obj = pop
if str != obj.to_s
if str != obj.__send__(:to_s)
# TODO: must be some raise here
# if to_s failed to convert an object
binding.irb
Expand Down
3 changes: 0 additions & 3 deletions tags/language/alias_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ fails:The alias keyword operates on the class/module metaclass when used in inst
fails:The alias keyword operates on the class/module metaclass when used in instance_exec
fails:The alias keyword operates on methods defined via attr, attr_reader, and attr_accessor
fails:The alias keyword is not allowed against Fixnum or String instances
fails:The alias keyword on top level defines the alias on Object
fails:The alias keyword can create a new global variable, synonym of the original
fails:The alias keyword can override an existing global variable and make them synonyms
1 change: 0 additions & 1 deletion tags/language/def_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ fails:An instance method raises an error with too many arguments
fails:An instance method definition with a splat requires the presence of any arguments that precede the *
fails:An instance method with a default argument evaluates the default when required arguments precede it
fails:An instance method with a default argument prefers to assign to a default argument before a splat argument
fails:A singleton method definition can be declared for a global variable
fails:Redefining a singleton method does not inherit a previously set visibility
fails:A nested method definition creates an instance method when evaluated in an instance method
fails:A nested method definition creates a class method when evaluated in a class method
Expand Down
2 changes: 0 additions & 2 deletions tags/language/encoding_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion tags/language/hash_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
fails:Hash literal freezes string keys on initialization
fails:Hash literal raises a TypeError if any splatted elements keys are not symbols
fails:Hash literal raises a TypeError if #to_hash does not return a Hash
1 change: 0 additions & 1 deletion tags/language/predefined/data_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:The DATA constant does not exist when the main script contains no __END__
fails:The DATA constant is set even if there is no newline after __END__
1 change: 0 additions & 1 deletion tags/language/predefined/toplevel_binding_tags.txt

This file was deleted.

9 changes: 0 additions & 9 deletions tags/language/regexp/encoding_tags.txt

This file was deleted.

13 changes: 0 additions & 13 deletions tags/language/return_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,4 @@ fails:The return keyword within a block causes the method that lexically enclose
fails:The return keyword within a block returns from the lexically enclosing method even in case of chained calls
fails:The return keyword within a block returns from the lexically enclosing method even in case of chained calls(in yield)
fails:The return keyword within a block causes the method to return even when the immediate parent has already returned
fails:The return keyword at top level stops file execution
fails:The return keyword at top level within if is allowed
fails:The return keyword at top level within while loop is allowed
fails:The return keyword at top level within a begin is allowed in begin block
fails:The return keyword at top level within a begin is allowed in ensure block
fails:The return keyword at top level within a begin is allowed in rescue block
fails:The return keyword at top level within a begin fires ensure block before returning
fails:The return keyword at top level within a begin fires ensure block before returning while loads file
fails:The return keyword at top level within a begin swallows exception if returns in ensure block
fails:The return keyword at top level within a block is allowed
fails:The return keyword at top level within a class raises a SyntaxError
fails:The return keyword at top level file loading stops file loading and execution
fails:The return keyword at top level file requiring stops file loading and execution
fails:The return keyword at top level return with argument does not affect exit status
1 change: 0 additions & 1 deletion tags/language/singleton_class_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:A singleton class has class String as the superclass of a String instance
fails:A constant on a singleton class cannot be accessed via object::CONST
6 changes: 0 additions & 6 deletions tags/language/string_tags.txt

This file was deleted.

0 comments on commit f8903e3

Please sign in to comment.