Avoid hard fault when reading vectors in text section.

This commit is contained in:
huangkai8 2023-04-19 15:29:37 +08:00 committed by Petro Karashchenko
parent 90f8315432
commit 8f297f79d8

View File

@ -77,11 +77,6 @@ static bool in_code_region(unsigned long pc)
{
int i = 0;
if (pc >= (unsigned long)_START_TEXT && pc < (unsigned long)_END_TEXT)
{
return true;
}
if (g_backtrace_code_regions)
{
while (g_backtrace_code_regions[i] &&
@ -98,6 +93,13 @@ static bool in_code_region(unsigned long pc)
}
}
/* When g_backtrace_code_regions is null, try to use all the text section */
else if (pc >= (unsigned long)_START_TEXT && pc < (unsigned long)_END_TEXT)
{
return true;
}
return false;
}