From a58cbddd57152a3a4712c6b37b6efa3c108847e7 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Tue, 27 Sep 2022 19:27:39 -0400 Subject: YJIT: add assertion wrt label names (#6459) Add assertion wrt label names --- yjit/src/asm/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yjit') diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs index 22b46e6aca..f5501a4bc7 100644 --- a/yjit/src/asm/mod.rs +++ b/yjit/src/asm/mod.rs @@ -220,6 +220,8 @@ impl CodeBlock { /// Allocate a new label with a given name pub fn new_label(&mut self, name: String) -> usize { + assert!(!name.contains(" "), "use underscores in label names, not spaces"); + // This label doesn't have an address yet self.label_addrs.push(0); self.label_names.push(name); -- cgit v1.2.3