mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-11 04:48:10 +00:00
Allow string literals for [N]byte
This commit is contained in:
@@ -5126,7 +5126,15 @@ lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bool allow_loc
|
||||
LLVMValueRef data = LLVMConstStringInContext(ctx,
|
||||
cast(char const *)value.value_string.text,
|
||||
cast(unsigned)value.value_string.len,
|
||||
false);
|
||||
false /*DontNullTerminate*/);
|
||||
res.value = data;
|
||||
return res;
|
||||
} else if (is_type_u8_array(type) && value.kind == ExactValue_String) {
|
||||
GB_ASSERT(type->Array.count == value.value_string.len);
|
||||
LLVMValueRef data = LLVMConstStringInContext(ctx,
|
||||
cast(char const *)value.value_string.text,
|
||||
cast(unsigned)value.value_string.len,
|
||||
true /*DontNullTerminate*/);
|
||||
res.value = data;
|
||||
return res;
|
||||
} else if (is_type_array(type) &&
|
||||
|
||||
Reference in New Issue
Block a user