[all-commits] [llvm/llvm-project] b877c3: [YAMLIO] Correctly diagnose empty alias/anchor

Scott Linder via All-commits all-commits at lists.llvm.org
Mon Nov 16 10:45:52 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b877c35d4b2cc67f7c3d96698fcd3845683ce5e2
      https://github.com/llvm/llvm-project/commit/b877c35d4b2cc67f7c3d96698fcd3845683ce5e2
  Author: Scott Linder <Scott.Linder at amd.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M llvm/lib/Support/YAMLParser.cpp
    M llvm/unittests/Support/YAMLIOTest.cpp

  Log Message:
  -----------
  [YAMLIO] Correctly diagnose empty alias/anchor

The `Range` of an alias/anchor token includes the leading `&` or `*`,
but it is skipped while parsing the name. The check for an empty name
fails to account for the skipped leading character and so the error is
never hit.

Fix the off-by-one and add a couple regression tests.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D91462




More information about the All-commits mailing list