summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2022-09-27 19:27:39 -0400
committerGitHub <noreply@github.com>2022-09-27 19:27:39 -0400
commita58cbddd57152a3a4712c6b37b6efa3c108847e7 (patch)
treee7fab15294b7c04dae01c98a2ae857e6f4cd2ae0
parent8fcbb79742b27619683f0a5f25497a402eeca56f (diff)
YJIT: add assertion wrt label names (#6459)
Add assertion wrt label names
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
-rw-r--r--yjit/src/asm/mod.rs2
1 files changed, 2 insertions, 0 deletions
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);