Skip to content

Commit 1f6d272

Browse files
committed
累计bug修复
1.过早结束综合 2.编译返回值错误 3.冗余代码
1 parent 5266a97 commit 1f6d272

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Spawn/Language/Verilog.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export class Verilog extends Language {
2020
skip: false,
2121
command: getConfig().language.xst,
2222
args: ["-ifn", "main.xst"],
23+
spawnOption: {
24+
timeLimit: 60000,
25+
},
2326
};
2427
},
2528
};

src/Spawn/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ export function hengSpawn(
4343
const subProcess = spawn(command, args, basicOption);
4444
return Object.assign(subProcess, {
4545
result: new Promise((resolve, reject) => {
46-
subProcess.on("exit", (code, signal) => {
46+
subProcess.on("close", (code, signal) => {
4747
let signalNumber = -1;
4848
if (signal) {
4949
signalNumber = constants.signals[signal];
5050
}
5151
resolve({
5252
memory: 0,
53-
returnCode: code ?? 10,
53+
returnCode: code ?? 9,
5454
signal: signalNumber,
5555
time: {
5656
real: 0,

src/Utilities/Judge.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ export class NormalJudgeAgent extends JudgeAgent {
371371
const buffer = Buffer.alloc(output.length);
372372
const start = Date.now();
373373
await port.write(input);
374-
const timeout = setTimeout(closePort, judgeTimeout, port);
374+
setTimeout(closePort, judgeTimeout, port);
375375
try {
376376
while (memory < output.length) {
377377
const { bytesRead } = await port.read(
@@ -389,7 +389,6 @@ export class NormalJudgeAgent extends JudgeAgent {
389389
} catch {
390390
kind = JudgeResultKind.TimeLimitExceeded;
391391
}
392-
clearTimeout(timeout);
393392
await closePort(port);
394393
time = Date.now() - start;
395394
}

0 commit comments

Comments
 (0)