lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


There's definitely something wrong with the JIT here.

The line where I call bit_set_1 looks like this:

  bit_set_1(_bset,_byte,_bit)

I tried to add an assertion afterwards:

  bit_set_1(_bset,_byte,_bit)
  assert(bit_get(_bset,_byte,_bit) == 1)

This assertion is never triggered, and *the code works*
when it's here (ie. it gives the expected output).

The bit_get function looks like this:

  local bit_get = function(_bset,_byte,_bit)
    return band(brshift(_bset[_byte],7-_bit),1)
  end

PS: in real code the bit_ functions are in a separate module,
I have abstracted that in snippets to make them simpler.

--
Pierre 'catwell' Chapuis