Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8264acc

Browse files
committedMar 17, 2025·
Forbid comparisons with alloc.ptr, not just allocator.ptr
1 parent 321e97d commit 8264acc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎test/internal/ban-words.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const words: Record<string, { reason: string; limit?: number; regex?: boolean }>
2323
"allocator.ptr !=": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior", limit: 1 },
2424
"== allocator.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
2525
"!= allocator.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
26+
"alloc.ptr ==": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
27+
"alloc.ptr !=": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
28+
"== alloc.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
29+
"!= alloc.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" },
2630
[String.raw`: [a-zA-Z0-9_\.\*\?\[\]\(\)]+ = undefined,`]: { reason: "Do not default a struct field to undefined", limit: 251, regex: true },
2731
};
2832
const words_keys = [...Object.keys(words)];

0 commit comments

Comments
 (0)
Please sign in to comment.