Skip to content

Commit 064f674

Browse files
committed
better replacements for fcalls backend
Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@manchester.ac.uk>
1 parent f26fbca commit 064f674

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

kraft/app/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,10 @@ def simple_replace(template_path, path, marker, shstack_enabled=True):
800800

801801
# then generate cocci files dynamically from the template
802802
gr_rule_template = get_sec_rule("gatereplacer.cocci.in")
803-
cb_rule_template = get_sec_rule("callbackreplacer.cocci.in")
803+
if FCALLS_enabled:
804+
cb_rule_template = get_sec_rule("rmcallbacks.cocci.in")
805+
else:
806+
cb_rule_template = get_sec_rule("callbackreplacer.cocci.in")
804807
gr_rule_template = gr_rule_template.replace("{{ comp_cur_nb }}",
805808
str(lib.compartment.number))
806809
cb_rule_template = cb_rule_template.replace("{{ comp_cur_nb }}",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@cbvoid{{ rule_nr }}@
2+
identifier func;
3+
type T;
4+
@@
5+
6+
- __attribute__(({{ lib_from_name }}_callback))
7+
T func(...) {
8+
...
9+
}

0 commit comments

Comments
 (0)