aboutsummaryrefslogtreecommitdiff
path: root/boot/symbol.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-15 14:46:38 +0200
committerEugen Wissner <belka@caraus.de>2026-10-15 14:46:38 +0200
commit56a1244380133ab400f98d2da15353e080ffb360 (patch)
treef4e0aef02c8d356fc2c67bfdb2f1c490858c24cf /boot/symbol.cc
parentde6ecae0f072bb32be95382c536a517eabe4b1f1 (diff)
downloadelna-56a1244380133ab400f98d2da15353e080ffb360.tar.gz
Restrict index types to Int and WordHEADcpp
Diffstat (limited to 'boot/symbol.cc')
-rw-r--r--boot/symbol.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/boot/symbol.cc b/boot/symbol.cc
index 8feba4a..310ae8a 100644
--- a/boot/symbol.cc
+++ b/boot/symbol.cc
@@ -830,6 +830,21 @@ namespace elna::boot
|| is_float_type(checked);
}
+ bool is_index_type(const type& checked, const target_info& target)
+ {
+ const type unaliased = resolve_underlying_type(checked);
+ if (const auto primitive = unaliased.get<primitive_type>())
+ {
+ const bool is_int = primitive->identifier.starts_with("Int")
+ && primitive->properties.size == target.int_properties.front().size;
+ const bool is_word = primitive->identifier.starts_with("Word")
+ && primitive->properties.size == target.word_properties.front().size;
+
+ return is_int || is_word;
+ }
+ return false;
+ }
+
bool is_integral_type(const type& checked)
{
return is_integer_type(checked) || is_word_type(checked);