add object method missing as sys exit
functions get added twice and thus removed once remove restriction for now
This commit is contained in:
@ -31,13 +31,13 @@ module Risc
|
||||
return compiler.method
|
||||
end
|
||||
|
||||
def exit context
|
||||
def exit( context )
|
||||
compiler = compiler_for(:Kernel,:exit ,{})
|
||||
emit_syscall( compiler , :exit )
|
||||
return compiler.method
|
||||
end
|
||||
|
||||
def emit_syscall compiler , name
|
||||
def emit_syscall( compiler , name )
|
||||
save_message( compiler )
|
||||
compiler.add_code Syscall.new("emit_syscall(#{name})", name )
|
||||
restore_message(compiler)
|
||||
|
@ -33,6 +33,13 @@ module Risc
|
||||
return compiler.method
|
||||
end
|
||||
|
||||
# every object needs a method missing.
|
||||
# Even if it's just this one, sys_exit (later raise)
|
||||
def _method_missing( context )
|
||||
compiler = compiler_for(:Object,:method_missing ,{})
|
||||
Risc::Builtin::Kernel.emit_syscall( compiler , :exit )
|
||||
return compiler.method
|
||||
end
|
||||
end
|
||||
extend ClassMethods
|
||||
end
|
||||
|
Reference in New Issue
Block a user