blob: e2ab92ee9c72db307f4c94acb3bf043771861753 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/python3
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import dietc
prog = dietc.Program(open(sys.argv[1], "rb").read())
for function in prog.functions:
fn_locals = function.locals()
start_i = function.code_start()
for local in fn_locals:
function.insert(start_i, f"\tMEMZERO ( {local} ) ;")
prog.print()
|