Skip to content

Commit b850fbd

Browse files
committed
Add timeout for better protection
1 parent 956f443 commit b850fbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ export async function verilator_lint(filenames: string[], dirname?: string, opti
12041204
try {
12051205
const output: LintMessage[] = [];
12061206
const verilator_result: {stdout: string, stderr: string} = await promisify(child_process.exec)(
1207-
'verilator -lint-only -Wall -Wno-DECLFILENAME -Wno-UNOPT -Wno-UNOPTFLAT ' + filenames.map(shell_escape).join(' '),
1207+
'timeout -k10s 40s verilator -lint-only -Wall -Wno-DECLFILENAME -Wno-UNOPT -Wno-UNOPTFLAT ' + filenames.map(shell_escape).join(' '),
12081208
{maxBuffer: 1000000, cwd: dirname || null, timeout: options.timeout || 60000})
12091209
.catch(exc => exc);
12101210
for (const line of verilator_result.stderr.split('\n')) {
@@ -1246,7 +1246,7 @@ export async function process(filenames: string[], dirname?: string, options: Op
12461246
const tmpjson = await tmp.tmpName({ postfix: '.json' });
12471247
let obj = undefined;
12481248
const yosys_result: {stdout: string, stderr: string, killed?: boolean, code?: number} = await promisify(child_process.exec)(
1249-
'yosys -p "' + shell_escape_contents(filenames.map(process_filename).join('; ')) +
1249+
'timeout -k10s 40s yosys -p "' + shell_escape_contents(filenames.map(process_filename).join('; ')) +
12501250
'; hierarchy -auto-top; proc' + optimize_simp + fsmpass + '; memory -nomap; wreduce -memx' +
12511251
optimize + '" -o "' + tmpjson + '"',
12521252
{maxBuffer: 1000000, cwd: dirname || null, timeout: options.timeout || 60000})

0 commit comments

Comments
 (0)