Avoid exponential behavior in rust_evaluate_subexp
authorTom Tromey <tom@tromey.com>
Fri, 12 May 2017 04:22:36 +0000 (22:22 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 12 May 2017 14:52:55 +0000 (08:52 -0600)
commit6830f270e7b6676e7a77c1b8080941e35003d918
treea7faa0b7cb23adbb74344da8be58760bd5779562
parent68f2f2e308a8585c39ddb2f391a9ae8d779c5029
Avoid exponential behavior in rust_evaluate_subexp

The STRUCTOP_STRUCT case in rust_evaluate_subexp would evaluate its
LHS, and then, if it did not need Rust-specific treatment, it would
back up and re-evaluate the entire STRUCTOP_STRUCT part of the
expression using evaluate_subexp_standard.  This yields exponential
behavior and causes some expressions to evaluate extremely slowly.

The fix is to simply do the needed work inline.

This is PR rust/21483.

ChangeLog
2017-05-12  Tom Tromey  <tom@tromey.com>

PR rust/21483:
* rust-lang.c (rust_evaluate_subexp) <STRUCTOP_STRUCT>: Don't
recurse, just call value_struct_elt directly.
gdb/ChangeLog
gdb/rust-lang.c
This page took 0.025618 seconds and 4 git commands to generate.