help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [bug] CStruct pointers-to-CStructs don't work properly


From: Tony Garnock-Jones
Subject: [Help-smalltalk] [bug] CStruct pointers-to-CStructs don't work properly
Date: Thu, 03 Jan 2008 08:15:39 -0700

Issue status update for http://smalltalk.gnu.org/node/148 Post a follow up: http://smalltalk.gnu.org/project/comments/add/148

Project:      GNU Smalltalk
Version:      <none>
Component:    Base classes
Category:     bug reports
Priority:     normal
Assigned to:  Unassigned
Reported by:  tonyg
Updated by:   tonyg
Status:       active
Attachment:   http://smalltalk.gnu.org/files/issues/ctype.patch (643 bytes)

Given a CStruct #StructA with a member #b of type (#ptr #StructB), I was
expecting to be able to call

st> myA b
CPtr(16r80728C4)

as well as

st> myA b value
StructB(16r80728D0)

However, what I actually get is:

st> myA b value
Object: CPtr new: 1 "<0x40338b18>" error: Invalid argument StructB
SystemExceptions.WrongClass(Exception)>>signal
SystemExceptions.WrongClass class(SystemExceptions.InvalidValue
class)>>signalOn:
CPtr(CObject)>>derefAt:type:
CPtr>>value
UndefinedObject>>executeStatements
nil

The fault is in CType>>#storeOn: and CType class>>#from:. The #storeOn:
method prints the raw cObjectType instance variable, where it should
print "self cObjectType" instead; and #from: returns a class,
(Namespace current at: type), where it should return the class's type,
((Namespace current at: type) type).

Patch against gst 2.95h attached. Test case to follow.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]