mirror of https://github.com/inolen/redream.git
fix case where ta_get_context could return an unallocated context for
address 0, as it was iterating over all available contexts, not just the allocated ones
This commit is contained in:
parent
621f65ca78
commit
ff4eefa36d
|
@ -349,7 +349,7 @@ static holly_interrupt_t list_interrupts[] = {
|
|||
};
|
||||
|
||||
static struct ta_context *ta_get_context(struct ta *ta, uint32_t addr) {
|
||||
for (int i = 0; i < ARRAY_SIZE(ta->contexts); i++) {
|
||||
for (int i = 0; i < ta->num_contexts; i++) {
|
||||
struct ta_context *ctx = &ta->contexts[i];
|
||||
if (ctx->addr == addr) {
|
||||
return ctx;
|
||||
|
|
Loading…
Reference in New Issue