Skip to content

Commit

Permalink
adding classification for function pointers (#84)
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch and vsoch committed Sep 14, 2021
1 parent 406c887 commit c9923a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/parser/x86_64/classifiers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ namespace smeagle::x86_64 {
return {RegisterClass::INTEGER, RegisterClass::NO_CLASS, "Enum"};
}

inline classification classify(st::typeFunction *t) { return {}; }
inline classification classify(st::typeFunction *t) {
auto [underlying_type, ptr_cnt] = unwrap_underlying_type(t);
if (ptr_cnt > 0) {
return classify_pointer(ptr_cnt);
}
return {};
}

// Classify a single field
classification classify(st::Field *f) {
Expand Down

0 comments on commit c9923a6

Please sign in to comment.