mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Add sanity check in lb_create_procedure
This commit is contained in:
@@ -192,7 +192,7 @@ lbValue lb_addr_get_ptr(lbProcedure *p, lbAddr const &addr) {
|
|||||||
offset = lb_emit_load(p, offset);
|
offset = lb_emit_load(p, offset);
|
||||||
|
|
||||||
if (!is_type_unsigned(rel_ptr->RelativePointer.base_integer)) {
|
if (!is_type_unsigned(rel_ptr->RelativePointer.base_integer)) {
|
||||||
offset = lb_emit_conv(p, offset, t_i64);
|
offset = lb_emit_conv(p, offset, t_i64);
|
||||||
}
|
}
|
||||||
offset = lb_emit_conv(p, offset, t_uintptr);
|
offset = lb_emit_conv(p, offset, t_uintptr);
|
||||||
lbValue absolute_ptr = lb_emit_arith(p, Token_Add, ptr, offset, t_uintptr);
|
lbValue absolute_ptr = lb_emit_arith(p, Token_Add, ptr, offset, t_uintptr);
|
||||||
@@ -2741,6 +2741,9 @@ void lb_ensure_abi_function_type(lbModule *m, lbProcedure *p) {
|
|||||||
lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool ignore_body) {
|
lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool ignore_body) {
|
||||||
GB_ASSERT(entity != nullptr);
|
GB_ASSERT(entity != nullptr);
|
||||||
GB_ASSERT(entity->kind == Entity_Procedure);
|
GB_ASSERT(entity->kind == Entity_Procedure);
|
||||||
|
if (!entity->Procedure.is_foreign) {
|
||||||
|
GB_ASSERT(entity->flags |= EntityFlag_ProcBodyChecked);
|
||||||
|
}
|
||||||
|
|
||||||
String link_name = {};
|
String link_name = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user