Fix virus detection false positive (#3944).

This commit is contained in:
Wilson Snyder 2023-02-08 18:44:07 -05:00
parent 072d76fe8e
commit cf88700fc2
2 changed files with 15 additions and 8 deletions

View File

@ -26,6 +26,7 @@ Verilator 5.007 devel
* Fix single-element replication to dynarray/unpacked/queue (#3548). [Gustav Svensk]
* Fix very long VPI signal names (#3929). [Marlon James]
* Fix VPI upper interface scopes not found (#3937). [David Stanford]
* Fix virus detection false positive (#3944). [Stuart Morris]
Verilator 5.006 2023-01-22

View File

@ -14,21 +14,27 @@ use vars qw($Self);
scenarios(simulator => 1);
# Greek Hi
my $hi = "Greek: " . c(0xce) . c(0xb3) . c(0xce) . c(0xb5) . c(0xce) . c(0xb9) . c(0xce) . c(0xb1);
sub c {
# Appease https://www.virustotal.com NANO-Antivirus gives Trojan.Script.Vbs-heuristic flag
my $code = shift;
return eval("c" . "h" . "r(" . $code . ")");
}
sub gen {
my $filename = shift;
my $fh = IO::File->new(">$filename");
$fh->print(chr(0xEF).chr(0xBB).chr(0xBF)); # BOM
$fh->print(c(0xEF));
$fh->print(c(0xBB));
$fh->print(c(0xBF)); # BOM
$fh->print("// Bom\n");
$fh->print("// Generated by t_unicode.pl\n");
$fh->print("module t;\n");
$fh->print(" // Chinese "
. chr(0xe8) . chr(0xaf) . chr(0x84) . chr(0xe8) . chr(0xae) . chr(0xba) # Comment
. "\n");
$fh->print(" // " . $hi . "\n");
$fh->print(" initial begin\n");
$fh->print(" \$write(\"Hello "
. chr(0xe4) . chr(0xb8) . chr(0x96) . chr(0xe7) . chr(0x95) . chr(0x8c) # World
. "\\n\");\n");
$fh->print(" \$write(\"" . $hi . "\\n\");\n");
$fh->print(" \$write(\"*-* All Finished *-*\\n\");\n");
$fh->print(" \$finish;\n");
$fh->print(" end\n");
@ -44,7 +50,7 @@ compile(
execute(
check_finished => 1,
expect => q{Hello \344\270\226\347\225\214.*},
expect => $hi,
);
ok(1);