Patch 8.2.5005 (after 8.2.5003)
Problem: Compiler warning for uninitialized variable. (John Marriott)
Solution: Initialize the pointer to NULL.
Files: src/vim9expr.vim
*** ../vim-8.2.5004/src/vim9expr.c 2022-05-22 20:16:28.857115519 +0100
--- src/vim9expr.c 2022-05-22 21:51:53.232277214 +0100
***************
*** 2635,2642 ****
char_u *next;
int len = 2;
int ppconst_used = ppconst->pp_used;
- typval_T *tv1;
- typval_T *tv2;
isn_T *isn;
// get the first variable
--- 2635,2640 ----
***************
*** 2662,2669 ****
// Handle a bitwise left or right shift operator
if (ppconst->pp_used == ppconst_used + 1)
{
! tv1 = &ppconst->pp_tv[ppconst->pp_used - 1];
! if (tv1->v_type != VAR_NUMBER)
{
// left operand should be a number
emsg(_(e_bitshift_ops_must_be_number));
--- 2660,2666 ----
// Handle a bitwise left or right shift operator
if (ppconst->pp_used == ppconst_used + 1)
{
! if (ppconst->pp_tv[ppconst->pp_used - 1].v_type != VAR_NUMBER)
{
// left operand should be a number
emsg(_(e_bitshift_ops_must_be_number));
***************
*** 2702,2709 ****
if (ppconst->pp_used == ppconst_used + 2)
{
// Both sides are a constant, compute the result now.
- tv2 = &ppconst->pp_tv[ppconst->pp_used - 1];
if (tv2->v_type != VAR_NUMBER || tv2->vval.v_number < 0)
{
// right operand should be a positive number
--- 2699,2708 ----
if (ppconst->pp_used == ppconst_used + 2)
{
+ typval_T *tv1 = &ppconst->pp_tv[ppconst->pp_used - 2];
+ typval_T *tv2 = &ppconst->pp_tv[ppconst->pp_used - 1];
+
// Both sides are a constant, compute the result now.
if (tv2->v_type != VAR_NUMBER || tv2->vval.v_number < 0)
{
// right operand should be a positive number
***************
*** 2825,2831 ****
if (ppconst->pp_used == ppconst_used + 2)
{
! typval_T * tv1 = &ppconst->pp_tv[ppconst->pp_used - 2];
typval_T *tv2 = &ppconst->pp_tv[ppconst->pp_used - 1];
int ret;
--- 2824,2830 ----
if (ppconst->pp_used == ppconst_used + 2)
{
! typval_T *tv1 = &ppconst->pp_tv[ppconst->pp_used - 2];
typval_T *tv2 = &ppconst->pp_tv[ppconst->pp_used - 1];
int ret;
*** ../vim-8.2.5004/src/version.c 2022-05-22 20:16:28.861115514 +0100
--- src/version.c 2022-05-22 21:49:07.668314301 +0100
***************
*** 736,737 ****
--- 736,739 ----
{ /* Add new patch number below this line */
+ /**/
+ 5005,
/**/
--
hundred-and-one symptoms of being an internet addict:
269. You wonder how you can make your dustbin produce Sesame Street's
Oscar's the Garbage Monster song when you empty it.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220522205354.29C0E1C06D7%40moolenaar.net.