Skip to content
  • Peter Maydell's avatar
    ad18376b
    target/xtensa: Assert that interrupt level is within bounds · ad18376b
    Peter Maydell authored
    
    
    In handle_interrupt() we use level as an index into the interrupt_vector[]
    array. This is safe because we have checked it against env->config->nlevel,
    but Coverity can't see that (and it is only true because each CPU config
    sets its XCHAL_NUM_INTLEVELS to something less than MAX_NLEVELS), so it
    complains about a possible array overrun (CID 1507131)
    
    Add an assert() which will make Coverity happy and catch the unlikely
    case of a mis-set XCHAL_NUM_INTLEVELS in future.
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
    Message-id: 20230623154135.1930261-1-peter.maydell@linaro.org
    ad18376b
    target/xtensa: Assert that interrupt level is within bounds
    Peter Maydell authored
    
    
    In handle_interrupt() we use level as an index into the interrupt_vector[]
    array. This is safe because we have checked it against env->config->nlevel,
    but Coverity can't see that (and it is only true because each CPU config
    sets its XCHAL_NUM_INTLEVELS to something less than MAX_NLEVELS), so it
    complains about a possible array overrun (CID 1507131)
    
    Add an assert() which will make Coverity happy and catch the unlikely
    case of a mis-set XCHAL_NUM_INTLEVELS in future.
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
    Message-id: 20230623154135.1930261-1-peter.maydell@linaro.org
Loading