Thanks Julia,
On 04/26/2012 06:42 PM, Julia Lawall wrote:
> You want <+... ...+> not <... ...>
that did the trick. One of this days I might get a feeling for those
constructs too.
> If you want to allow the thing not to appear, you need to do that in an
> outer ( | )
bye
michael
> On Thu, 26 Apr 2012, Michael Stefaniuc wrote:
>
>> Hello,
>>
>> I'm stuck with a SmPL problem:
>> @@
>> idexpression ret;
>> @@
>> ok(<... ret ...>, ...);
>> ... when != ret
>> *ok
>> (<... ret ...>, ...);
>>
>> spatch --parse-cocci accepts it but when running it I get:
>> Fatal error: exception Failure("only handling multi and no when code in
>> a nest expr")
>> <... ret ...> inside ok() is the culprit.
>>
>> I'm trying for days to think of a workaround for this (e.g. splitting it
>> into different rules) but I'm drawing a blank on it.
>>
>> ok() is the test function/macro in the Wine tests which evaluates its
>> first arg to see if the test succeeded. The rest of the varargs are the
>> printf style message in case the test fails. I'm trying to check that a
>> variable isn't tested in two ok() calls without being modified in
>> between. The expression in the first arg passed to ok() can be fairly
>> complex with "ret" showing up multiple times. I've attached some sample
>> code.
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)