summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline/rtems/score/object.inl
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-10 15:19:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-10 15:19:15 +0000
commit681d452637e1500deaae084954e9fa702b9d347d (patch)
tree17dd97f56658bf3107b306e970b947bd60a8fccb /cpukit/score/inline/rtems/score/object.inl
parent2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-681d452637e1500deaae084954e9fa702b9d347d.tar.bz2
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/inline/rtems/score/object.inl: _Objects_Get_local_object() is only called from places where the index is known to be valid. _Objects_Set_local_object() already assumed this. Eliminates unreachable code.
Diffstat (limited to 'cpukit/score/inline/rtems/score/object.inl')
-rw-r--r--cpukit/score/inline/rtems/score/object.inl13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
index ced5e75a9d..7db87bdde9 100644
--- a/cpukit/score/inline/rtems/score/object.inl
+++ b/cpukit/score/inline/rtems/score/object.inl
@@ -198,15 +198,22 @@ RTEMS_INLINE_ROUTINE bool _Objects_Are_ids_equal(
* @param[in] index is the index of the object the caller wants to access
*
* @return This method returns a pointer to a local object or NULL if the
- * index is invalid.
+ * index is invalid and RTEMS_DEBUG is enabled.
*/
RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Get_local_object(
Objects_Information *information,
uint16_t index
)
{
- if ( index > information->maximum )
- return NULL;
+ /*
+ * This routine is ONLY to be called from places in the code
+ * where the Id is known to be good. Therefore, this should NOT
+ * occur in normal situations.
+ */
+ #if defined(RTEMS_DEBUG)
+ if ( index > information->maximum )
+ return NULL;
+ #endif
return information->local_table[ index ];
}