Pass slices to CreateInterfaceObjects2 rather than raw pointers.

This commit is contained in:
Ms2ger 2014-06-06 14:01:09 +02:00
parent 3dece6b7ab
commit 0c54cd1634
2 changed files with 68 additions and 47 deletions

View file

@ -1942,8 +1942,8 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
def arrayPtr(name):
val = ('%(' + name + ')s') % self.properties.variableNames(False)
if val == "ptr::null()":
return val
return "&%s[0]" % val
return "None"
return "Some(%s.as_slice())" % val
call = """return CreateInterfaceObjects2(aCx, aGlobal, aReceiver, parentProto,
%s, %s, %d,