From a571af816d72727e16cad37007e7043b9d6fa362 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Mon, 8 Apr 2013 15:00:13 -0500 Subject: [PATCH] Fixed definition of bli_is_packed_object() macro. Details: - Changed the definition of bli_is_packed_object() so that it keys off of the value of the pack schema bits in the info field of obj_t, rather than comparing the obj_t buffer with that of the mem_t entry. This was the cause of a very low probability bug whereby uninitialized memory caused the macro to evaluate to TRUE even though the object in question was not packed. Thanks to Vernon Austel of IBM for helping discover this bug. - Changed an abort() in bli_packm_part() to a not-yet-implemented. --- frame/1m/packm/bli_packm_part.c | 2 +- frame/include/bli_obj_macro_defs.h | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frame/1m/packm/bli_packm_part.c b/frame/1m/packm/bli_packm_part.c index 179fbd80b..af6ac9747 100644 --- a/frame/1m/packm/bli_packm_part.c +++ b/frame/1m/packm/bli_packm_part.c @@ -246,7 +246,7 @@ dim_t bli_packm_offset_to_panel_for( dim_t offmn, obj_t* p ) else { panel_off = 0; - bli_abort(); + bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); } return panel_off; diff --git a/frame/include/bli_obj_macro_defs.h b/frame/include/bli_obj_macro_defs.h index ec69cbc99..d9a2a3640 100644 --- a/frame/include/bli_obj_macro_defs.h +++ b/frame/include/bli_obj_macro_defs.h @@ -822,15 +822,12 @@ bli_obj_width_stored( obj ) // Check if an object is a packed object -// (ie: was a pack buffer acquired for this object; TRUE here does not mean -// the actual packing is complete, such as with incremental packing.) +// NOTE: TRUE here does not mean the actual packing is complete, such as with +// incremental packing.) #define bli_obj_is_packed( obj ) \ \ - ( bli_obj_buffer( obj ) == bli_mem_buffer( bli_obj_pack_mem( obj ) ) && \ - bli_obj_buffer( obj ) != NULL \ - ? TRUE \ - : FALSE ) \ + ( bli_obj_pack_status( obj ) != BLIS_NOT_PACKED ) \ // Release object's pack (and cast) memory entries back to memory manager