GCC Has helpfully pointed out that we're doing some strange things:
second/fs_reiserfs.c: In function ‘block_read’:
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c: In function ‘next_key’:
second/fs_reiserfs.c:619: warning: operation on ‘depth’ may be undefined
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
if ( *journal_table != 0xffffffff )
{
/* Search for the blockNr in cached journal */
if ( *journal_table != 0xffffffff )
{
/* Search for the blockNr in cached journal */
- j_len = le32_to_cpu(*journal_table++);
+ j_len = le32_to_cpu((*journal_table)++);
while ( i++ < j_len )
{
if ( le32_to_cpu(*journal_table++) == blockNr )
while ( i++ < j_len )
{
if ( le32_to_cpu(*journal_table++) == blockNr )
cache = CACHE( depth );
else
{
cache = CACHE( depth );
else
{
- cache = read_tree_node( INFO->blocks[depth], --depth );
+ /* Save depth as using it twice as args to read_tree_node()
+ * has undefined behaviour */
+ __u16 d = depth;
+ cache = read_tree_node( INFO->blocks[d], --depth );
if ( !cache )
return 0;
}
if ( !cache )
return 0;
}