Skip to content

Commit 4f6576f

Browse files
committed
fix: adjusted USER confidence behavior in rd_i_set_type()
1 parent c15594a commit 4f6576f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/types/type.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,14 @@ bool rd_i_set_type(RDContext* ctx, RDAddress address, const char* name, usize n,
263263
usize startidx_exp = idx, endidx_exp = startidx_exp + sz;
264264
rd_i_expand_range(ctx, seg, &startidx_exp, &endidx_exp);
265265

266-
if(rd_i_flagsbuffer_has_code_n(seg->flags, startidx_exp,
267-
endidx_exp - startidx_exp))
266+
// an AUTO/LIBRARY caller must not silently reinterpret code as data:
267+
// that's the classic misclassification.
268+
// A USER asking for it is a deliberate override.
269+
if(c < RD_CONFIDENCE_USER &&
270+
rd_i_flagsbuffer_has_code_n(seg->flags, startidx_exp,
271+
endidx_exp - startidx_exp)) {
268272
return false;
273+
}
269274

270275
if(!rd_i_undefine_n(ctx, address, sz, c)) return false;
271276

0 commit comments

Comments
 (0)