WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit f29a1fd6 authored by Stefan Marr's avatar Stefan Marr
Browse files

Bind primitive methods to object to make all invokables behave identically



- primitives where not properly bound, while normal methods had a bound invoke() and thus were working differently at the call site, this should now be fixed by binding the primitive methods
Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 8831585b
......@@ -112,7 +112,7 @@ class Interpreter(object):
if invokable:
# Invoke the invokable in the current frame
invokable.invoke(invokable, self.get_frame(), self)
invokable.invoke(self.get_frame(), self)
else:
# Compute the number of arguments
num_args = signature.get_number_of_signature_arguments()
......@@ -240,7 +240,7 @@ class Interpreter(object):
if invokable:
# Invoke the invokable in the current frame
invokable.invoke(invokable, self.get_frame(), self)
invokable.invoke(self.get_frame(), self)
else:
num_args = selector.get_number_of_signature_arguments()
......
from som.vmobjects.object import Object
from som.vmobjects.invokable import Invokable
import types
class Primitive(Object, Invokable):
# Static field indices and number of primitive fields
......@@ -17,7 +19,7 @@ class Primitive(Object, Invokable):
# Set the signature of this primitive
self._set_signature(universe.symbol_for(signature_string))
self.invoke = invoke
self.invoke = types.MethodType(invoke, self)
if is_empty:
self.is_empty = is_empty
......@@ -52,10 +54,10 @@ class Primitive(Object, Invokable):
@classmethod
def get_empty_primitive(cls, signature_string, universe):
# Return an empty primitive with the given signature
def _invoke(self, frame, interpreter):
def _invoke(ivkbl, frame, interpreter):
# Write a warning to the screen
universe.std_println("Warning: undefined primitive " +
self.get_signature().get_string() + " called")
ivkbl.get_signature().get_string() + " called")
# The empty primitives are empty
def _is_empty(self): return True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment