待辦事項 #43871

luascript_func_check(): variable used uninitialized on FREECIV_NDEBUG build

啟用日期: 2022-02-15 20:00 最後更新: 2022-03-06 02:36

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

luascript_func_check() sets variable pfunc within fc_assert_ret_val(), i.e., it's not set in FREECIV_NDEBUG builds. Later code expects it to be set.

Ticket History (3/6 Histories)

2022-02-15 20:00 Updated by: cazfi
  • New Ticket "luascript_func_check(): variable used uninitialized on FREECIV_NDEBUG build" created
2022-02-20 23:26 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
  • 里程碑 Update from (無) to 3.0.1 (closed)
評語

Will push also to S2_6.

2022-03-04 04:14 Updated by: cazfi
  • 處理結果 Update from Accepted to
評語

As fc_assert_ret_val() is one of the macros of the fc_assert family that we still have active even on --disable-debug builds, there's no *currently* functional bug, and this patch causes compilation failure instead.

Even in case of fc_assert_ret_val(), it's forbidden to have functionality inside it, for the purposes of being able to disable them on ndebug builds on some future versions. So this patch is still needed, just have to fix the compile error.

2022-03-04 04:23 Updated by: cazfi
  • 處理結果 Update from to Accepted
評語

Reply To cazfi

As fc_assert_ret_val() is one of the macros of the fc_assert family that we still have active even on --disable-debug builds, there's no *currently* functional bug, and this patch causes compilation failure instead.

No, that was true for S2_6 only. In later branches the functionality is broken + there's no compile failure with the patch -> going to push existing patch to S3_0+, and will do nothing to S2_6.

2022-03-06 02:36 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入