Skip to content

Commit

Permalink
Merge pull request #4578 from michaellilltokiwa/fuir--improve-robustn…
Browse files Browse the repository at this point in the history
…ess-of-clazz_array_u8,-etc-

fuir: improve robustness of clazz_array_u8, etc.
  • Loading branch information
michaellilltokiwa authored Jan 9, 2025
2 parents 906d35b + 019b089 commit 9a4d0da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dev/flang/fuir/FUIR.java
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public int clazz_const_string_utf8_data()
public int clazz_array_u8()
{
var utf8_data = clazz_const_string_utf8_data();
return clazzResultClazz(utf8_data);
return utf8_data == NO_CLAZZ ? NO_CLAZZ : clazzResultClazz(utf8_data);
}


Expand All @@ -758,9 +758,8 @@ public int clazz_array_u8()
public int clazz_fuzionSysArray_u8()
{
var a8 = clazz_array_u8();
var ia = lookup_array_internal_array(a8);
var res = clazzResultClazz(ia);
return res;
var ia = a8 == NO_CLAZZ ? NO_CLAZZ : lookup_array_internal_array(a8);
return ia == NO_CLAZZ ? NO_CLAZZ : clazzResultClazz(ia);
}


Expand All @@ -772,7 +771,7 @@ public int clazz_fuzionSysArray_u8()
public int clazz_fuzionSysArray_u8_data()
{
var sa8 = clazz_fuzionSysArray_u8();
return lookup_fuzion_sys_internal_array_data(sa8);
return sa8 == NO_CLAZZ ? NO_CLAZZ : lookup_fuzion_sys_internal_array_data(sa8);
}


Expand All @@ -784,7 +783,7 @@ public int clazz_fuzionSysArray_u8_data()
public int clazz_fuzionSysArray_u8_length()
{
var sa8 = clazz_fuzionSysArray_u8();
return lookup_fuzion_sys_internal_array_length(sa8);
return sa8 == NO_CLAZZ ? NO_CLAZZ : lookup_fuzion_sys_internal_array_length(sa8);
}


Expand Down

0 comments on commit 9a4d0da

Please sign in to comment.