)]}'
{
  "commit": "554128418b4f1328bb956d5926f24bfd56fd45ea",
  "tree": "abb729ac8648540d29b432f9c54ae4d4d6672311",
  "parents": [
    "e4146092c3f147b8c395febc771edd7de23f724d"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Jul 20 13:00:40 2022 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Jul 25 19:26:24 2022 +0100"
  },
  "message": "gdb: fix use of uninitialised gdb_printing_disassembler::m_in_comment\n\nSimon pointed out that gdb_printing_disassembler::m_in_comment can be\nused uninitialised by the Python disassembler API code.  This issue\nwas spotted when GDB was built with the undefined behaviour sanitizer,\nand causes the gdb.python/py-disasm.exp test to fail like this:\n\n  (gdb) PASS: gdb.python/py-disasm.exp: global_disassembler\u003dGlobalPreInfoDisassembler: python add_global_disassembler(GlobalPreInfoDisassembler)\n  disassemble main\n  Dump of assembler code for function main:\n     0x0000555555555119 \u003c+0\u003e:     push   %rbp\n     0x000055555555511a \u003c+1\u003e:     mov    %rsp,%rbp\n     0x000055555555511d \u003c+4\u003e:     nop\n  /home/user/src/binutils-gdb/gdb/disasm.h:144:12: runtime error: load of value 118, which is not a valid value for type \u0027bool\u0027\n\nThe problem is that in disasmpy_builtin_disassemble we create a new\ninstance of gdbpy_disassembler, which is a sub-class of\ngdb_printing_disassembler, however, the m_in_comment field is never\ninitialised.\n\nThis commit fixes the issue by providing a default initialisation\nvalue for m_in_comment in disasm.h.  As we only ever disassemble a\nsingle instruction in disasmpy_builtin_disassemble then we don\u0027t need\nto worry about reseting m_in_comment back to false after the single\ninstruction has been disassembled.\n\nWith this commit the above issue is resolved and\ngdb.python/py-disasm.exp now passes.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2921d537e0ab4a7ae31dc8720396163939c25b67",
      "old_mode": 33188,
      "old_path": "gdb/disasm.h",
      "new_id": "09cb392176717f173336f565f81ab843723eeae1",
      "new_mode": 33188,
      "new_path": "gdb/disasm.h"
    }
  ]
}
