[PING,D] Re-apply change for handling non-local references in nested functions

Message ID CABOHX+fu+oKh6evsp65ZdLtXUqb7U2s57zn9Ndm=oK2AYXejKQ@mail.gmail.com
State New, archived
Headers

Commit Message

Iain Buclaw Oct. 6, 2015, 4:52 p.m. UTC
  Another belated ping, again I'll go ahead with it as its trivial/obvious.

---
Hi,

This was first applied by Pierre-Marie back in February (see
63e43d3aedb8b1112899c2d0ad74cbbee687e5d6), but my re-write of d-exp.y
was written about 6 months earlier, and I subsequently missed it when
backporting upstream changes.

This reapplies that change.

Regards
Iain
  

Comments

Pedro Alves Oct. 20, 2015, 12:01 p.m. UTC | #1
On 10/06/2015 05:52 PM, Iain Buclaw wrote:
> Another belated ping, again I'll go ahead with it as its trivial/obvious.
> 
> ---
> Hi,
> 
> This was first applied by Pierre-Marie back in February (see
> 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6), but my re-write of d-exp.y
> was written about 6 months earlier, and I subsequently missed it when
> backporting upstream changes.
> 
> This reapplies that change.
> 

In these cases, I really see no need to wait for pre-commit review.
You should feel comfortable to go ahead immediately.

Thanks,
Pedro Alves
  

Patch

gdb/ChangeLog:

	* d-exp.y: Remove an obsolete comment and propagate the block
	information to the produced expression.

---
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index dd87d8a..b66565d 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -483,9 +483,7 @@  PrimaryExpression:
 			}
 
 		      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
-		      /* We want to use the selected frame, not another more inner frame
-			 which happens to be in the same block.  */
-		      write_exp_elt_block (pstate, NULL);
+		      write_exp_elt_block (pstate, sym.block);
 		      write_exp_elt_sym (pstate, sym.symbol);
 		      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
 		    }