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.2% of users enabled 2FA.

Commit 5bb4fed0 authored by Stefan Marr's avatar Stefan Marr
Browse files

Pass lists as copies to make them immutable in RPython


Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent d0185f55
......@@ -11,6 +11,9 @@ class ClassGenerationContext(object):
self._class_fields = []
self._class_methods = []
def get_name(self):
return self._name
def set_name(self, symbol):
self._name = symbol
......@@ -64,8 +67,10 @@ class ClassGenerationContext(object):
result_class = self._universe.new_class(self._universe.metaclassClass)
# Initialize the class of the resulting class
result_class.set_instance_fields(self._universe.new_array_from_list(self._class_fields))
result_class.set_instance_invokables(self._universe.new_array_from_list(self._class_methods))
result_class.set_instance_fields(self._universe.new_array_from_list(
self._class_fields[:]))
result_class.set_instance_invokables(self._universe.new_array_from_list(
self._class_methods[:]))
result_class.set_name(self._universe.symbol_for(cc_name))
super_m_class = super_class.get_class(self._universe)
......@@ -77,16 +82,22 @@ class ClassGenerationContext(object):
# Initialize the resulting class
result.set_name(self._name)
result.set_super_class(super_class)
result.set_instance_fields(self._universe.new_array_from_list(self._instance_fields))
result.set_instance_invokables(self._universe.new_array_from_list(self._instance_methods))
result.set_instance_fields(self._universe.new_array_from_list(
self._instance_fields[:]))
result.set_instance_invokables(self._universe.new_array_from_list(
self._instance_methods[:]))
return result
def assemble_system_class(self, system_class):
system_class.set_instance_invokables(self._universe.new_array_from_list(self._instance_methods))
system_class.set_instance_fields(self._universe.new_array_from_list(self._instance_fields))
system_class.set_instance_invokables(
self._universe.new_array_from_list(self._instance_methods[:]))
system_class.set_instance_fields(
self._universe.new_array_from_list(self._instance_fields[:]))
# class-bound == class-instance-bound
super_mclass = system_class.get_class(self._universe)
super_mclass.set_instance_invokables(self._universe.new_array_from_list(self._class_methods))
super_mclass.set_instance_fields(self._universe.new_array_from_list(self._class_fields))
super_m_class = system_class.get_class(self._universe)
super_m_class.set_instance_invokables(
self._universe.new_array_from_list(self._class_methods[:]))
super_m_class.set_instance_fields(
self._universe.new_array_from_list(self._class_fields[:]))
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