about summary refs log tree commit diff
path: root/src/libstd/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorAlexey Tarasov <tarasov@dodologics.com>2017-08-20 21:35:00 +1000
committerAlexey Tarasov <tarasov@dodologics.com>2017-08-23 23:10:03 +1000
commite13090e8b2f8adce9277f2ebfa37efa75c8837a8 (patch)
treef7cee317cf6ed47503d3ee921d0615cd977027cf /src/libstd/sys/unix/process/process_unix.rs
parenta3f0ee9a7b17d522bfc6385f841d040445730f28 (diff)
downloadrust-e13090e8b2f8adce9277f2ebfa37efa75c8837a8.tar.gz
rust-e13090e8b2f8adce9277f2ebfa37efa75c8837a8.zip
Fixes issue #43205: ICE in Rvalue::Len evaluation.
- fixes evaluation of array length for zero-sized type referenced by
  rvalue operand.
- adds test to verify fix.

Cause of the issue.

Zero-sized aggregates are handled as operands, not lvalues. Therefore while
visiting Assign statement by LocalAnalyser, mark_as_lvalue() is not called for
related Local. This behaviour is controlled by rvalue_creates_operand() method.
As result it causes error later, when rvalue operand is evaluated in
trans_rvalue_operand() while handling Rvalue::Len case. Array length evaluation
invokes trans_lvalue() which expects referenced Local to be value, not operand.

How it is fixed.

In certain cases result of Rvalue::Len can be evaluated without calling
trans_lvalue(). Method evaluate_array_len() is introduced to handle length
evaluation for zero-sized types referenced by Locals.
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions