objb crashes because of syntax error

Please report bugs.

objb crashes because of syntax error

Postby udo.killermann » Sat Nov 06, 2010 10:24 am

Bernd,

while typing in the evening the compiler greeted me with the following message (no it was actually crash reporter):
objbCrash.jpg
objbCrash.jpg (26.86 KiB) Viewed 740 times


Here comes the offending code (I have marked the misbehaving statement).
Code: Select all
Declare Class "NSPredicate"
Declare Function "NSPredicate" - (NSString *)predicateFormat
Declare Function "NSPredicate" - (BOOL)evaluateWithObject:(id)object
Declare Function "NSPredicate" + (NSPredicate *)predicateWithFormat:(NSString *)predicateFormat
Declare Function "NSPredicate" + (NSPredicate *)predicateWithValue:(BOOL)value

Declare Function "NSMutableArray" - (NSArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate


Dim tick As String(Character(39))
Dim myPred As NSPredicate = Nil
Dim predStr As String

Function filterArray(theArray As Array, Filter As String) As Array   
    predStr = Concat("SELF LIKE ", tick, Filter, tick)
    myPred = NSPredicate.predicateWithFormat( predStr)
    Return(theArray.filteredArrayUsingPredicate(myPred))
End Function

Event AwakeFromNib()
   Dim myArray As NSMutableArray
   Dim resultArray As NSMutableArray
   
   myArray = Array("fest.o","zz.mm","heike.o","udo.mm")
 
   Alert(filterArray(myArray,"*.o"))
   Alert(filterArray(myArray),"*.mm") ' this crashes the compiler
End Event


By just omitting an argument to a function the compiler gets in an unstable state. I didn't strip the example down, but hope you can spot the glitch.

I had to sleep over this in order to understand the root cause. It occurred before but I couldn't pin the problem.

Regards
Udo
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Return to Bug Reports (Xcode 3)

Who is online

Users browsing this forum: No registered users and 2 guests