mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 13:52:50 +01:00
verification/rvgen: Generate each variable definition only once
If a variable appears multiple times in the specification, ltl2k generates multiple variable definitions. This fails the build. Make sure each variable is only defined once. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Gabriele Monaco <[email protected]> Link: https://lore.kernel.org/107dcf0d0aa8482d5fbe0314c3138f61cd284e91.1752850449.git.namcao@linutronix.de Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
1 parent
8cfcf9b0e9
commit
6fb37c2a27
1 file changed
+5
-3
@@ -112,14 +112,16 @@ class ltl2k(generator.Monitor):
|
||||
if node.op.is_temporal():
|
||||
continue
|
||||
|
||||
if isinstance(node.op, ltl2ba.Variable):
|
||||
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (node, node.op.name))
|
||||
elif isinstance(node.op, ltl2ba.AndOp):
|
||||
if isinstance(node.op, ltl2ba.AndOp):
|
||||
buf.append("\tbool %s = %s && %s;" % (node, node.op.left, node.op.right))
|
||||
elif isinstance(node.op, ltl2ba.OrOp):
|
||||
buf.append("\tbool %s = %s || %s;" % (node, node.op.left, node.op.right))
|
||||
elif isinstance(node.op, ltl2ba.NotOp):
|
||||
buf.append("\tbool %s = !%s;" % (node, node.op.child))
|
||||
|
||||
for atom in self.atoms:
|
||||
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (atom.lower(), atom))
|
||||
|
||||
buf.reverse()
|
||||
|
||||
buf2 = []
|
||||
|
||||
Reference in new issue
Block a user