Skip to content

Commit

Permalink
Fix build with latest r2-599
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Feb 27, 2025
1 parent cc735df commit 57f3267
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/R2Scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ Symbol *R2Scope::registerFlag(RFlagItem *flag) const {
if (!bo) {
continue;
}
#if R2_VERSION_NUMBER >= 50909
void *s = ht_up_find (bo->strings_db, flag->addr, nullptr);
#else
void *s = ht_up_find (bo->strings_db, flag->offset, nullptr);
#endif
if (s) {
str = reinterpret_cast<RBinString *>(s);
break;
Expand Down Expand Up @@ -483,7 +487,12 @@ Symbol *R2Scope::registerFlag(RFlagItem *flag) const {

// Check whether flags should be displayed by their real name
const char *name = (core->flags->realnames && flag->realname) ? flag->realname : flag->name;
SymbolEntry *entry = cache->addSymbol (name, type, Address (arch->getDefaultCodeSpace(), flag->offset), Address());
#if R2_VERSION_NUMBER >= 50909
const ut64 at = flag->addr;
#else
const ut64 at = flag->offset;
#endif
SymbolEntry *entry = cache->addSymbol (name, type, Address (arch->getDefaultCodeSpace(), at), Address());
if (!entry) {
return nullptr;
}
Expand Down

0 comments on commit 57f3267

Please sign in to comment.