YJIT: add assertion wrt label names (#6459)

Add assertion wrt label names
This commit is contained in:
Maxime Chevalier-Boisvert 2022-09-27 19:27:39 -04:00 committed by GitHub
parent 8fcbb79742
commit a58cbddd57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-09-28 08:28:03 +09:00
Merged-By: maximecb <maximecb@ruby-lang.org>

View File

@ -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);