Open lab313ru opened 1 year ago
You can enable the warning of colliding constructors using the -c argument to the sleigh constructor.
Just checked. It looks like -c
flag doesn't work. I don't get any warning regarding colliding group implementations.
Do you mean sleighArgs.txt ?
Yes in the sleighArgs.txt file.
You can also use "-l" to help root out constructor order issues where two patterns could be matched and the one that comes first will match.
I'd try both to see if either can report the issue.
It requires removing sla
manually to get these options work.
Also, only specifying both options does work. In result it outputs something like that:
ERROR lang.slaspec:1285: Constructor patterns cannot be distinguished:
InstructionPattern{1.0..... 0....... 00001010} table "instruction" constructor from lang.slaspec:1285
InstructionPattern{1....... 01110... 0000101.} table "instruction" constructor from lang.slaspec:1271 (SleighCompile)
We should possibly consider adding these options on by default when a language is created initially.
Then remove them for processors that have order issues, like the ARM.
In my language I have one group with two collisioning rules, which can be applied both to the same bytes sequence, but I don't get any warning about that from Sleigh compiler.
It looks something like that:
If both lines are enabled Sleigh gets the first one, but commenting the first gives me the second definition. It would be great to get a warning about such things.