Skip to contentSkip to conversation

coccinelle match fail

cocci Denis Efremov 2 participants 3 messages Apr 2, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

for some reason this pattern doesn't match.

/// git checkout 96518518cc417bb0a8c80b9fb736202e28acdf96 /// spatch test.cocci net/netfilter/nf_tables_core.c

@err exists@
identifier data, expr;
@@

nft_do_chain(...)

{
	...
*	struct nft_data data[NFT_REG_MAX + 1];
	...
*	expr->ops->eval(..., &data, ...);
	...
}

These 2 lines doesn't match simultaneously. If you comment out one of them the pattern will match. Could you help me to understand what could be the problem here?

Thanks,
Denis Efremov

#1 lore raw
Quoted 20 lines · Denis Efremov

Hi,

for some reason this pattern doesn't match.

/// git checkout 96518518cc417bb0a8c80b9fb736202e28acdf96 /// spatch test.cocci net/netfilter/nf_tables_core.c

@err exists@
identifier data, expr;
@@

nft_do_chain(...)

{
	...
*	struct nft_data data[NFT_REG_MAX + 1];
	...
*	expr->ops->eval(..., &data, ...);
	...
}
Quoted 3 lines

These 2 lines doesn't match simultaneously. If you comment out one of them the pattern will match. Could you help me to understand what could be the problem here?

I think there is just a typo in your rule. As far as I can see in the code, there is no & in front of data. If I remove that, then all is fine.

julia

#2 lore raw
Quoted 3 lines · Julia Lawall

I think there is just a typo in your rule. As far as I can see in the code, there is no & in front of data. If I remove that, then all is fine.

Thank you! My bad, sorry for the mess.

Regards,
Denis Efremov